From: punixcorn <ohyunwoods663@gmail.com>
To: seanjc@google.com, pbonzini@redhat.com
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
punixcorn <ohyunwoods663@gmail.com>
Subject: [BUG] KVM: NULL pointer dereference in kvm_tdp_mmu_map under memory pressure
Date: Wed, 8 Apr 2026 10:29:14 +0000 [thread overview]
Message-ID: <20260408102914.106838-1-ohyunwoods663@gmail.com> (raw)
Under host memory pressure, a NULL pointer dereference occurs in
kvm_tdp_mmu_map() at offset 0x24. The exact root cause is unclear --
it may be an unhandled NULL return from tdp_mmu_alloc_sp(), or a
violated invariant elsewhere in the map path.
Crash log:
BUG: kernel NULL pointer dereference, address: 0000000000000024
#PF: supervisor read access in kernel mode
Oops: 0000 [#1] SMP NOPTI
CPU: 2 PID: 1110212 Comm: MainLoopThread Tainted: G U OE 6.19.10-arch1-1
Hardware name: Default Default/NLXB, BIOS BQ141 06/27/2024
RIP: 0010:kvm_tdp_mmu_map+0x471/0x880 [kvm]
Code: 00 00 00 80 48 2b 35 76 72 5c c8 48 c7 44 24 20 00 00 00 00 48 01 f1 48 c1 e9 0c 48 c1 e1 06 48 03 0d 4b 72 5c c8 48 8b 71 28 <0f> b6 4e 24 83 e1 0f 39 ca 0f 85 a7 02 00 00 f6 c4 08 74 26 80 7b
RSP: 0018:ffffce128333f790 EFLAGS: 00010286
Reproduction:
The issue was observed under heavy host memory pressure while running
a KVM guest (Android emulator via QEMU).
The crash is not reliably reproducible and appears to be
timing-dependent. Fault injection targeting tdp_mmu_alloc_sp()
increases the frequency of hitting the same code path without
triggering a panic, suggesting the retry path may be a viable
recovery, though the exact failure condition is still unclear.
Fault injection used:
sp = tdp_mmu_alloc_sp(vcpu);
if (!sp || (atomic_inc_return(&fail_counter) % 100 == 0)) {
if (sp) tdp_mmu_free_sp(sp);
goto retry;
}
With this injection the guest continues running normally initially,
but eventually terminates after sustained injection pressure. This is
expected behavior given the repeated forced failures.
A speculative fix:
if (!sp)
goto retry;
This has not been fully verified. Sending for maintainer review.
Environment:
Linux 6.19.10-arch1-1 x86_64
GNU C 15.2.1
Binutils 2.46
Signed-off-by: punixcorn <ohyunwoods663@gmail.com>
next reply other threads:[~2026-04-08 10:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-08 10:29 punixcorn [this message]
2026-04-08 11:21 ` punixcorn
2026-04-08 14:18 ` Sean Christopherson
[not found] <202604081418.sean.christopherson@intel.com>
2026-04-08 15:36 ` punixcorn
2026-04-08 16:33 ` Sean Christopherson
[not found] <202604081633.sean.christopherson@intel.com>
2026-04-08 18:43 ` punixcorn
2026-04-13 21:47 ` Sean Christopherson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260408102914.106838-1-ohyunwoods663@gmail.com \
--to=ohyunwoods663@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®