[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[BUG] WARNING in __kvm_gpc_refresh (virt/kvm/pfncache.c:267, v7.4-rc3)


  • To: pbonzini@xxxxxxxxxx
  • From: Zheng Zheng <fengaojigui88@xxxxxxxxx>
  • Date: Sun, 22 Nov 2026 01:28:39 +0800
  • Arc-authentication-results: i=1; mx.google.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:cc:to:subject:message-id:date:from :mime-version:dkim-signature; bh=DCLA3o2NGcsUsCeKdpfpu0O9OUOc9q0N8lXAsyG+wTU=; fh=NtqU41rBBkZENgVqV2HtIBTK+Xy9L603M0ZkEykZDvQ=; b=pkQIjK+LJJPpzavPLmIzMG2boBWUNDrf9OV7gB2sk5nm5aaCLvLId7HBrhXRkNRkVk GOIuu9gEMaJRpwpzFGLK2Ibgl4tmim99qPAmzVYL79DFiaMbkLRVLVj/e2lWwlNwqexx Ya+DzROXm3N6rePBEXhyDXpT5iR7WfPi4jY+E9+yp9nNJtY6CkR0yZDlhPcfxtyhb4qS qcdf/DqC8MrI+/WMsxN7NZvUc4au3Rfnn6FfNX4DgCpQ1UlxAG2nJpIaDKdI1IljpjDO 9v0nQdt4/KdlFvDzFdsuIrUQE66aMYtecP2Kz4UQULzz0KKnYRzoMPQ3+hNSDI0BPXiq tPiA==; darn=lists.xenproject.org
  • Arc-seal: i=1; a=rsa-sha256; t=1795282134; cv=none; d=google.com; s=arc-20260327; b=Wc3DWOOcPD+FTBVW+SEMVmOP2yHjPuUrozvJK3gbkuSvqu0IvI9QhI4W97oN1eKXBY UR7E1EBenPXFRgJJJBMNrmwto4Id4NxSmxbwDuXkbQxwAnH5L1A9DVVT8rJPCZjIB08+ tt1n6T8niG//ts/pyCwwTjtiy3xMg9evJUolaChMvH4sjw2/t4h7tXSw0Gub/WHc8Eed 3+WG6/7JuzNapT7iFbj2sKH/2EiTw2IupR6hQ5xVXnTvDvtgWA8X1m1AZqQ1RzL+Ku2j e4e7CVSJoprLFvPV9Kbo5ql8IuYHDeL3ImMyIjhWaSYD1r0HoJ6iDJdGqzLyajOLgv4T HN3w==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=20260707 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:Cc:To:Subject:Message-ID:Date:From:MIME-Version"
  • Cc: seanjc@xxxxxxxxxx, dwmw@xxxxxxxxxxxx, kvm@xxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, syzkaller-bugs@xxxxxxxxxxxxxxxx
  • Delivery-date: Sat, 21 Nov 2026 18:32:44 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Paolo, Sean, David,

We found a reproducible warning on v7.4-rc3 with syzkaller: the KVM guest
page cache invariant "either gpa or uhva must be valid, but not both" is
violated while KVM emulates a Xen event-channel send.  The supplied
recipe reproduced on independent fresh VMs; no state snapshot is
required.

Repository and reproducer:

  https://github.com/Zheng-zheng-codes/kvm-gpc-refresh-warning
  commit f9bb1f09b4070e6b19fdc49a10297b2afe7e5fb8

Report
------

  kvm_is_error_gpa(gpa) == kvm_is_error_hva(uhva)
  WARNING: arch/x86/kvm/../../../virt/kvm/pfncache.c:267 at
__kvm_gpc_refresh+0x1692/0x1e40
  RIP: 0010:__kvm_gpc_refresh+0x1692/0x1e40 virt/kvm/pfncache.c:267
  Call Trace:
   kvm_gpc_refresh+0xed/0x160 virt/kvm/pfncache.c:382
   kvm_xen_set_evtchn.part.0+0x1b3/0x280 arch/x86/kvm/xen.c:2014
   kvm_xen_set_evtchn arch/x86/kvm/xen.c:2115 [inline]
   kvm_xen_hvm_evtchn_send+0x22f/0x290 arch/x86/kvm/xen.c:2105

The warning site:

  /* Either gpa or uhva must be valid, but not both */
  if (WARN_ON_ONCE(kvm_is_error_gpa(gpa) == kvm_is_error_hva(uhva)))
          return -EINVAL;

kvm_xen_set_evtchn() retries kvm_xen_set_evtchn_fast(), and on
-EWOULDBLOCK calls kvm_gpc_refresh(&kvm->arch.xen.shinfo_cache,
PAGE_SIZE), which re-refreshes the gpc with whatever gpa/uhva state the
cache currently holds.  In the failing run both representations were in
the same error state, so the refresh warned and returned -EINVAL and the
event-channel write failed.  The setup was a nested-KVM guest fuzzing the
KVM ioctls, including Xen HVM shared-info/event-channel configuration.

No memory corruption was observed; the effect is the WARN plus the failed
evtchn delivery.

Reproduction
------------

  git clone https://github.com/Zheng-zheng-codes/kvm-gpc-refresh-warning
  cd kvm-gpc-refresh-warning

  # boot v7.4-rc3 with the supplied kernel config
  # using a Debian trixie x86_64 guest

  # in the guest, as root:
  syz-execprog -procs=1 -threaded -repeat=1 \
      -executor ./syz-executor \
      reproducer/repro.kernsight.prog

The recipe is a state-reconstruction sequence (74 replay programs
followed by the crashing testcase).  The warning depends on the kernel
state built by the recipe; the testcase alone is not sufficient.  The
recipe must run with -procs=1; using -procs=8 did not reproduce the
warning under our tests.

Expected result: within about two minutes of starting the reproducer the
guest console shows

  kvm_is_error_gpa(gpa) == kvm_is_error_hva(uhva)
  WARNING: arch/x86/kvm/../../../virt/kvm/pfncache.c:267 at
__kvm_gpc_refresh+0x1692/0x1e40

and the event-channel write that triggered it fails.  All five of our
fresh-VM verification runs hit this at 120-121 seconds.

Verification:

- pipeline auto-repro: attempt 1 triggered (160 replay programs) but was
  not verified within the 20-minute budget; attempt 2 verified
  (confirmed=true, status=verified, fresh-VM recipe replay, 74 replay
  programs, 2026-11-21T14:59:08Z)
- stability on fresh VMs: five independent runs, 5/5 reproductions,
  120-121 s to the warning in every run (2026-11-21, external-verify/)
- C reproducer: not generated; the syzkaller recipe is the primary
  reproducer

Repository contents
-------------------

  README.md               overview, analysis and verification table
  environment.txt         kernel/guest hashes and exact QEMU command line
  kernel.config           kernel configuration used for the reproduction
  description             original crash title
  SHA256SUMS              SHA-256 checksums covering every file in the
repository
                        (including the five verification runs and
their HIT markers)
  logs/                   original crash evidence
    log0 — fuzzer log of the verified attempt
    machineInfo0 — VM/environment record
    report0 — crash report of the verified attempt
    title-stat — occurrence statistics
  reproducer/             the reproducer and its provenance
    repro.kernsight.prog — the reproducer: 74 replay programs followed
by the crashing testcase (log format)
    repro.prog — the crashing testcase alone (not sufficient)
    repro.priming.prog — the replay/priming prefix
    repro.priming.json — priming trace (candidate picks, distances)
    repro.context.json — reproduction context (fresh_vm_recipe_replay)
    repro.state.json — measured 539-D pre-crash state vector
    repro.report — raw crash report of the reproduction
    repro.stats — phase/timing log of the reproduction
    repro.README.txt — original bundle description
  external-verify/        five independent fresh-VM verification runs
    README.md             methodology and per-run results
    run-1 ... run-5/
      serial.log — full guest console of the run
      run.log — harness log with hashes and timings
      HIT — marker written when the target appeared

Kernel/guest details:

  kernel: v7.4-rc3, bzImage sha256
    0c16409f8aec508ac44a63e631c2bd352536401f3fd0856df1d839fb953a1882
  guest: Debian trixie x86_64, 6 GiB RAM, 4 vCPU, QEMU/KVM, nested KVM
  boot: oops=panic panic_on_warn=1 hung_task_panic=0 kvm-intel.nested=1
  config: CONFIG_KASAN=y, CONFIG_PROVE_LOCKING=y, CONFIG_KVM=y,
    CONFIG_KVM_XEN=y

Thanks,
Zheng



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.