{"id":"CVE-2026-99471","state":"PUBLISHED","title":"KVM: PPC: Book3S HV: Add SRCU protection for virtual-mode HPT hcalls","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nKVM: PPC: Book3S HV: Add SRCU protection for virtual-mode HPT hcalls\n\nThe virtual-mode HPT hcall handlers (H_ENTER, H_REMOVE, H_BULK_REMOVE,\nH_CLEAR_REF, H_CLEAR_MOD) call into book3s_hv_rm_mmu.c, which accesses\nmemslots via kvm_memslots_raw().  kvm_memslots_raw() uses\nrcu_dereference_raw_check() to bypass SRCU lockdep annotation checking.\nThis is safe in real mode because the entire guest entry/exit is wrapped\nin srcu_read_lock/unlock inside kvmppc_run_core() and\nkvmhv_run_single_vcpu().\n\nHowever, since commit 6165d5dd99db (\"KVM: PPC: Book3S HV: add virtual\nmode handlers for HPT hcalls and page faults\"), these same handlers are\nalso executed in virtual mode via kvmppc_pseries_do_hcall(), which runs\nafter SRCU has already been released on guest exit.\n\nA concurrent KVM_SET_USER_MEMORY_REGION deletion or move can therefore\ncall synchronize_srcu_expedited() — which does not wait for this thread —\nand then kfree(slot) and vfree(slot->arch.rmap) while the hcall handler\nstill holds a raw pointer to the memslot.  lock_rmap() then writes to\nfreed vmalloc memory, leading to use-after-free and memory corruption.\nBecause kvm_memslots_raw() suppresses lockdep checks, this race is\nentirely silent.\n\nFix this by factoring out the 7 HPT hcall handlers (H_REMOVE, H_ENTER,\nH_READ, H_CLEAR_MOD, H_CLEAR_REF, H_PROTECT, H_BULK_REMOVE) into a\nhelper function, kvmppc_pseries_do_hpt_hcall(), and wrapping its call\nsite in srcu_read_lock(&kvm->srcu) / srcu_read_unlock(&kvm->srcu, idx).\nTargeting only the HPT hcalls avoids wrapping non-HPT hcalls that sleep\n(such as H_CONFER, H_REGISTER_VPA, H_PAGE_INIT) or handlers that already\nacquire SRCU internally (such as H_RTAS).","publishedAt":"2026-11-19T14:42:57.597Z","updatedAt":"2026-11-22T11:08:28.672Z","severity":{"score":7.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"6165d5dd99dbaec7a309491c3951bd81fc89978d","status":"affected","lessThan":"0f86aba67317d65b2dc89995dd5ddefe219411a7","versionType":"git"},{"version":"6165d5dd99dbaec7a309491c3951bd81fc89978d","status":"affected","lessThan":"4ab2c987fd15a4bd28ef46a9ac871359886e6439","versionType":"git"},{"version":"6165d5dd99dbaec7a309491c3951bd81fc89978d","status":"affected","lessThan":"c3d0261c4fae2cc36dcf9f4e247552498232caff","versionType":"git"},{"version":"6165d5dd99dbaec7a309491c3951bd81fc89978d","status":"affected","lessThan":"61a39797bb136243c48b46e2586d8a9e2cea6a89","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/powerpc/kvm/book3s_hv.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.14","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.14","versionType":"semver"},{"version":"6.12.117","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.61","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.2","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/powerpc/kvm/book3s_hv.c"]}],"references":["https://git.kernel.org/stable/c/0f86aba67317d65b2dc89995dd5ddefe219411a7","https://git.kernel.org/stable/c/4ab2c987fd15a4bd28ef46a9ac871359886e6439","https://git.kernel.org/stable/c/c3d0261c4fae2cc36dcf9f4e247552498232caff","https://git.kernel.org/stable/c/61a39797bb136243c48b46e2586d8a9e2cea6a89"],"weaknesses":[],"ingestedAt":"2026-11-22T11:18:06.032Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/99xxx/CVE-2026-99471.json","commit":"247cc9beefd85903834df0592e88a44f4d599223","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-99471","state":"PUBLISHED","datePublished":"2026-11-19T14:42:57.597Z","dateUpdated":"2026-11-22T11:08:28.672Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-09-25T10:25:14.417Z"},"containers":{"cna":{"title":"KVM: PPC: Book3S HV: Add SRCU protection for virtual-mode HPT hcalls","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nKVM: PPC: Book3S HV: Add SRCU protection for virtual-mode HPT hcalls\n\nThe virtual-mode HPT hcall handlers (H_ENTER, H_REMOVE, H_BULK_REMOVE,\nH_CLEAR_REF, H_CLEAR_MOD) call into book3s_hv_rm_mmu.c, which accesses\nmemslots via kvm_memslots_raw().  kvm_memslots_raw() uses\nrcu_dereference_raw_check() to bypass SRCU lockdep annotation checking.\nThis is safe in real mode because the entire guest entry/exit is wrapped\nin srcu_read_lock/unlock inside kvmppc_run_core() and\nkvmhv_run_single_vcpu().\n\nHowever, since commit 6165d5dd99db (\"KVM: PPC: Book3S HV: add virtual\nmode handlers for HPT hcalls and page faults\"), these same handlers are\nalso executed in virtual mode via kvmppc_pseries_do_hcall(), which runs\nafter SRCU has already been released on guest exit.\n\nA concurrent KVM_SET_USER_MEMORY_REGION deletion or move can therefore\ncall synchronize_srcu_expedited() — which does not wait for this thread —\nand then kfree(slot) and vfree(slot->arch.rmap) while the hcall handler\nstill holds a raw pointer to the memslot.  lock_rmap() then writes to\nfreed vmalloc memory, leading to use-after-free and memory corruption.\nBecause kvm_memslots_raw() suppresses lockdep checks, this race is\nentirely silent.\n\nFix this by factoring out the 7 HPT hcall handlers (H_REMOVE, H_ENTER,\nH_READ, H_CLEAR_MOD, H_CLEAR_REF, H_PROTECT, H_BULK_REMOVE) into a\nhelper function, kvmppc_pseries_do_hpt_hcall(), and wrapping its call\nsite in srcu_read_lock(&kvm->srcu) / srcu_read_unlock(&kvm->srcu, idx).\nTargeting only the HPT hcalls avoids wrapping non-HPT hcalls that sleep\n(such as H_CONFER, H_REGISTER_VPA, H_PAGE_INIT) or handlers that already\nacquire SRCU internally (such as H_RTAS)."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"6165d5dd99dbaec7a309491c3951bd81fc89978d","status":"affected","lessThan":"0f86aba67317d65b2dc89995dd5ddefe219411a7","versionType":"git"},{"version":"6165d5dd99dbaec7a309491c3951bd81fc89978d","status":"affected","lessThan":"4ab2c987fd15a4bd28ef46a9ac871359886e6439","versionType":"git"},{"version":"6165d5dd99dbaec7a309491c3951bd81fc89978d","status":"affected","lessThan":"c3d0261c4fae2cc36dcf9f4e247552498232caff","versionType":"git"},{"version":"6165d5dd99dbaec7a309491c3951bd81fc89978d","status":"affected","lessThan":"61a39797bb136243c48b46e2586d8a9e2cea6a89","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/powerpc/kvm/book3s_hv.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.14","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.14","versionType":"semver"},{"version":"6.12.117","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.61","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.2","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/powerpc/kvm/book3s_hv.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/0f86aba67317d65b2dc89995dd5ddefe219411a7"},{"url":"https://git.kernel.org/stable/c/4ab2c987fd15a4bd28ef46a9ac871359886e6439"},{"url":"https://git.kernel.org/stable/c/c3d0261c4fae2cc36dcf9f4e247552498232caff"},{"url":"https://git.kernel.org/stable/c/61a39797bb136243c48b46e2586d8a9e2cea6a89"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - A host user reaches this from KVM_RUN (kvm_arch_vcpu_ioctl_run → kvmppc_vcpu_run_hv): after kvmhv_run_single_vcpu drops kvm->srcu, a supervisor-mode H_ENTER is handled in kvmppc_pseries_do_hcall → kvmppc_h_enter → kvmppc_do_h_enter, which calls kvm_memslots_raw(). No network protocol carries that input.\nAC:L - That user owns the vm fd, so one thread loops guest H_ENTER while another issues KVM_SET_USER_MEMORY_REGION delete or move. kvm_set_memslot's synchronize_srcu_expedited does not wait for the hcall, then kvm_free_memslot frees the slot. The same user selects HPT mode with KVM_PPC_CONFIGURE_V3_MMU.\nPR:L - arch/powerpc/kvm has no capable() check. kvm_dev_ioctl(KVM_CREATE_VM) and KVM_SET_USER_MEMORY_REGION need only an open /dev/kvm fd and kvm->mm == current->mm. kvmppc_handle_exit_hv drops sc 1 when MSR_PR is set, and the VM owner runs the guest with MSR_PR clear.\nUI:N - The VM owner issues both the H_ENTER hypercall through KVM_RUN and the memslot delete or move. No other principal has to mount an image, hot-unplug memory, or start migration.\nS:U - kvm_vm_ioctl frees a slot only when kvm->mm == current->mm, so the freeing thread is the host VM owner. lock_rmap then corrupts host kernel memory on that owner's KVM_RUN thread, under the host kernel's own authority.\nC:H - After kvmppc_core_free_memslot_hv vfree's arch.rmap, kvmppc_do_h_enter still reads *rmap and kvmppc_add_revmap_chain consumes KVMPPC_RMAP_PRESENT and KVMPPC_RMAP_INDEX from it. That use-after-free of a reclaimed page is a host kernel read of freed data.\nI:H - lock_rmap's test_and_set_bit_lock and kvmppc_add_revmap_chain's store of the guest-chosen pte_index both write through the dangling rmap pointer. On a move, kvm_commit_memory_region kfree's the slot while do_h_enter still loads memslot->arch.rmap from it.\nA:H - Those stores target a page kvmppc_core_free_memslot_hv has returned to the allocator. Corrupting the freelist or a reused kernel object on the vcpu thread oopses or panics the host."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-22T11:08:28.672Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.14","versionEndExcluding":"6.12.117"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.14","versionEndExcluding":"6.18.61"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.14","versionEndExcluding":"7.3.2"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.14","versionEndExcluding":"7.4-rc1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}