{"id":"CVE-2026-98464","kind":"vulnerability","aliases":["CVE-2026-98464"],"related":[],"title":"Linux KVM RISC-V: timer callback can use a freed vCPU during teardown","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nRISC-V: KVM: Synchronize hrtimer callback during teardown\n\nThe non-Sstc hrtimer callback clears next_set before its final uses of\nthe enclosing vCPU.  If teardown observes next_set as false while the\ncallback is still running, kvm_riscv_vcpu_timer_cancel() skips\nhrtimer_cancel() and kvm_destroy_vcpus() can free the vCPU before the\ncallback enters kvm_riscv_vcpu_set_interrupt().\n\nA guest can arm the timer with SBI TIME and request shutdown with SBI\nlegacy shutdown or SRST.  A VMM that honors KVM_EXIT_SYSTEM_EVENT and\ndestroys the VM supplies the teardown side of the race; no post-launch\nhost ioctl is needed to arm or request teardown.\n\nOn upstream master 62cc90241548, generic KASAN reported:\n\n  BUG: KASAN: slab-use-after-free in do_raw_spin_lock\n  Write of size 4 at addr ff60000005e58898\n\n  kvm_riscv_vcpu_set_interrupt\n  kvm_riscv_vcpu_hrtimer_expired\n  __hrtimer_run_queues\n  hrtimer_interrupt\n\nThe object was allocated by KVM_CREATE_VCPU and freed concurrently by:\n\n  kvm_destroy_vcpus\n  kvm_arch_destroy_vm\n  kvm_destroy_vm\n  __fput\n\nFor deterministic validation, I added mdelay(1000) immediately after\nthe existing next_set = false assignment.  This only widens the\nexisting post-clear callback window.  A no-delay trace build naturally\nreached the callback-after-teardown-start/before-deinit ordering in 12\nof 200 runs, but 1,500 stock-kernel stress iterations did not produce a\nKASAN report, so natural reproduction is timing-sensitive.\n\nAlways invoke hrtimer_cancel() for an initialized timer.  Preserve the\nexisting -EINVAL result when the timer is no longer set, but only after\nsynchronizing with a running callback.\n\nWith this patch, hrtimer_cancel() blocked for the full widened callback\nwindow before vCPU destruction.  KASAN reported no error in 100\nfixed-and-widened runs or 200 fix-only timing-sweep runs.","summary":"In the RISC-V KVM timer code, a timer callback can run after the guest vCPU has been freed during VM shutdown, causing a use-after-free in the kernel. A guest that arms the SBI timer and requests shutdown can trigger the race when the VMM destroys the VM, and the sources do not state a confirmed attacker outcome beyond the memory corruption.","severity":"unknown","cvss":null,"epss":null,"exploited":false,"exploited_at":null,"products":[],"ecosystems":[],"tags":["infrastructure","kvm","linux-kernel","riscv","self-hosted"],"not_affected_if":["kvm-not-used","no-riscv-hosts"],"how_to_check":"- Check whether the host runs a Linux kernel with RISC-V KVM enabled (`CONFIG_KVM` on a riscv64 host).\n- Compare the running kernel with the fixed upstream version: `uname -r`; the sources do not name a fixed version.\n- Check whether a VMM runs RISC-V guests with KVM: unknown.","fix":"- Update the Linux kernel to a release that includes the upstream fix (the sources do not name a version: unknown).\n- Until patched, avoid running RISC-V KVM guests on untrusted workloads: unknown.","status":"open","published_at":"2026-10-18T16:16:56+00:00","first_seen_at":"2026-10-23T21:57:15+00:00","triaged_at":"2026-10-25T05:27:14+00:00","updated_at":"2026-10-25T05:27:14+00:00","category":"infrastructure","confidence":0.6,"triage":{"at":"2026-10-25T05:27:14Z","model":"claude-haiku-5-5","output":{"fix":"- Update the Linux kernel to a release that includes the upstream fix (the sources do not name a version: unknown).\n- Until patched, avoid running RISC-V KVM guests on untrusted workloads: unknown.","reach":"local","title":"Linux KVM RISC-V: timer callback can use a freed vCPU during teardown","impact":"high","summary":"In the RISC-V KVM timer code, a timer callback can run after the guest vCPU has been freed during VM shutdown, causing a use-after-free in the kernel. A guest that arms the SBI timer and requests shutdown can trigger the race when the VMM destroys the VM, and the sources do not state a confirmed attacker outcome beyond the memory corruption.","category":"infrastructure","nicknames":[],"who_cares":["linux-kernel","riscv","kvm","self-hosted"],"confidence":0.6,"needs_auth":"unknown","worst_case":"Kernel memory corruption from a use-after-free, possibly code execution on the host.","analyst_note":"Find the upstream fixed kernel version and affected stable ranges in the kernel commit or the NVD entry at https://nvd.nist.gov/vuln/detail/CVE-2026-98464.","how_to_check":"- Check whether the host runs a Linux kernel with RISC-V KVM enabled (`CONFIG_KVM` on a riscv64 host).\n- Compare the running kernel with the fixed upstream version: `uname -r`; the sources do not name a fixed version.\n- Check whether a VMM runs RISC-V guests with KVM: unknown.","needs_analyst":true,"not_affected_if":["no-riscv-hosts","kvm-not-used"],"who_is_affected":"Hosts that run RISC-V KVM guests on the Linux kernel, where a guest can arm the SBI timer and request shutdown while the VMM destroys the VM. Hosts without RISC-V KVM are not affected by this flaw. The sources do not say which kernel versions are affected beyond upstream master at the time of testing.","user_interaction":"no","needs_special_setup":"yes","severity_if_unknown":"unknown"},"cost_usd":0.000772,"input_tokens":4021,"output_tokens":739,"severity_before":"unknown"},"analyst_status":null,"analyst_note":null,"search":"'-2026':16A,19A '-98464':17A,20A '/before-deinit':323C '1':331C '100':399C '1000':290C '12':326C '200':328C,406C '4':242C '500':332C '62cc90241548':223C 'add':288C 'addr':244C 'alloc':264C 'alway':351C 'arch':277C 'arm':65B,173C,216C 'assign':298C 'attack':90B 'beyond':92B 'block':384C 'bug':227C 'build':314C 'callback':7A,40B,112C,120C,141C,163C,307C,319C,378C,389C 'callback-after-teardown-start':318C 'cancel':149C,152C,354C,383C 'caus':53B 'clear':121C,306C 'code':37B 'concurr':271C 'confirm':89B 'corrupt':95B 'creat':267C 'cve':15A,18A 'delay':312C 'destroy':79B,155C,197C,274C,278C,281C 'destruct':393C 'determinist':285C 'einval':362C 'enclos':130C 'enter':164C 'error':397C 'event':195C 'exist':294C,303C,361C 'exit':193C 'expir':255C 'fals':138C,297C 'ff60000005e58898':245C 'final':126C 'fix':401C,408C 'fix-on':407C 'fixed-and-widen':400C 'follow':101C 'fput':283C 'free':58B,158C,233C 'freed':11A,49B,270C 'full':387C 'generic':224C 'guest':45B,63B,171C 'honor':191C 'host':29B,211C 'hrtimer':111C,119C,151C,254C,256C,259C,353C,382C 'immedi':291C 'infrastructur':21B 'initi':357C 'interrupt':169C,250C,260C 'invok':352C 'ioctl':212C 'iter':337C 'kasan':225C,228C,342C,394C 'kernel':25B,61B,99C,335C 'kvm':2A,22B,35B,109C,145C,154C,165C,192C,246C,251C,266C,273C,276C,280C 'launch':210C 'legaci':184C 'linux':1A,24B,98C 'linux-kernel':23B 'lock':238C 'longer':369C 'master':222C 'mdelay':289C 'memori':94B 'natur':315C,345C 'need':214C 'next':122C,135C,295C 'no-delay':310C 'non':117C 'non-sstc':116C 'object':262C 'observ':134C 'order':324C 'outcom':91B 'patch':381C 'post':209C,305C 'post-clear':304C 'post-launch':208C 'preserv':359C 'produc':340C 'queue':258C 'race':75B,206C 'raw':236C 'reach':316C 'report':226C,343C,395C 'reproduct':346C 'request':70B,180C,218C 'resolv':105C 'result':363C 'risc':4A,33B,107C 'risc-v':3A,32B,106C 'riscv':26B,146C,166C,247C,252C 'run':42B,144C,257C,329C,377C,404C,413C 'sbi':67B,177C,183C 'self':28B 'self-host':27B 'sensit':350C 'set':123C,136C,168C,249C,296C,370C 'shutdown':52B,71B,181C,185C 'side':203C 'size':241C 'skip':150C 'slab':230C 'slab-use-after-fre':229C 'sourc':84B 'spin':237C 'srst':187C 'sstc':118C 'start':322C 'state':87B 'still':143C 'stock':334C 'stock-kernel':333C 'stress':336C 'suppli':200C 'sweep':412C 'synchron':110C,374C 'system':194C 'teardown':14A,114C,133C,202C,219C,321C 'time':178C,349C,411C 'timer':6A,36B,39B,68B,148C,175C,358C,366C 'timing-sensit':348C 'timing-sweep':410C 'trace':313C 'trigger':73B 'upstream':221C 'use':9A,56B,127C,231C 'use-after-fre':55B 'v':5A,34B,108C 'valid':286C 'vcpu':12A,46B,131C,147C,160C,167C,248C,253C,268C,392C 'vcpus':156C,275C 'vm':51B,81B,199C,279C,282C 'vmm':78B,189C 'vulner':102C 'widen':301C,388C,403C 'window':308C,390C 'write':239C","nicknames":[],"mitigations":[],"who_affected":"Hosts that run RISC-V KVM guests on the Linux kernel, where a guest can arm the SBI timer and request shutdown while the VMM destroys the VM. Hosts without RISC-V KVM are not affected by this flaw. The sources do not say which kernel versions are affected beyond upstream master at the time of testing.","tier":"C","verified":{},"analyst_revisit_at":null,"first_public_at":"2026-10-18T16:16:56+00:00","kev":null,"cvss_vector":null,"cvss_by":null,"poc_count":0,"sources":[{"source":"nvd","external_id":"CVE-2026-98464","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-98464","severity":null,"published_at":"2026-10-18T16:16:56+00:00","modified_at":"2026-10-19T10:18:56+00:00","first_seen_at":"2026-10-23T21:57:15+00:00","fetched_at":"2026-10-23T22:28:56+00:00","note":null}],"documents":[],"notice":"Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai"}