{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2024-46830",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2024-46830"
  ],
  "published": "2024-09-27T12:40:05Z",
  "summary": "KVM: x86: Acquire kvm->srcu when handling KVM_SET_VCPU_EVENTS",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nKVM: x86: Acquire kvm->srcu when handling KVM_SET_VCPU_EVENTS\n\nGrab kvm->srcu when processing KVM_SET_VCPU_EVENTS, as KVM will forcibly\nleave nested VMX/SVM if SMM mode is being toggled, and leaving nested VMX\nreads guest memory.\n\nNote, kvm_vcpu_ioctl_x86_set_vcpu_events() can also be called from KVM_RUN\nvia sync_regs(), which already holds SRCU.  I.e. trying to precisely use\nkvm_vcpu_srcu_read_lock() around the problematic SMM code would cause\nproblems.  Acquiring SRCU isn't all that expensive, so for simplicity,\ngrab it unconditionally for KVM_SET_VCPU_EVENTS.\n\n =============================\n WARNING: suspicious RCU usage\n 6.10.0-rc7-332d2c1d713e-next-vm #552 Not tainted\n -----------------------------\n include/linux/kvm_host.h:1027 suspicious rcu_dereference_check() usage!\n\n other info that might help us debug this:\n\n rcu_scheduler_active = 2, debug_locks = 1\n 1 lock held by repro/1071:\n  #0: ffff88811e424430 (&vcpu->mutex){+.+.}-{3:3}, at: kvm_vcpu_ioctl+0x7d/0x970 [kvm]\n\n stack backtrace:\n CPU: 15 PID: 1071 Comm: repro Not tainted 6.10.0-rc7-332d2c1d713e-next-vm #552\n Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015\n Call Trace:\n  <TASK>\n  dump_stack_lvl+0x7f/0x90\n  lockdep_rcu_suspicious+0x13f/0x1a0\n  kvm_vcpu_gfn_to_memslot+0x168/0x190 [kvm]\n  kvm_vcpu_read_guest+0x3e/0x90 [kvm]\n  nested_vmx_load_msr+0x6b/0x1d0 [kvm_intel]\n  load_vmcs12_host_state+0x432/0xb40 [kvm_intel]\n  vmx_leave_nested+0x30/0x40 [kvm_intel]\n  kvm_vcpu_ioctl_x86_set_vcpu_events+0x15d/0x2b0 [kvm]\n  kvm_arch_vcpu_ioctl+0x1107/0x1750 [kvm]\n  ? mark_held_locks+0x49/0x70\n  ? kvm_vcpu_ioctl+0x7d/0x970 [kvm]\n  ? kvm_vcpu_ioctl+0x497/0x970 [kvm]\n  kvm_vcpu_ioctl+0x497/0x970 [kvm]\n  ? lock_acquire+0xba/0x2d0\n  ? find_held_lock+0x2b/0x80\n  ? do_user_addr_fault+0x40c/0x6f0\n  ? lock_release+0xb7/0x270\n  __x64_sys_ioctl+0x82/0xb0\n  do_syscall_64+0x6c/0x170\n  entry_SYSCALL_64_after_hwframe+0x4b/0x53\n RIP: 0033:0x7ff11eb1b539\n  </TASK>",
  "severity": [
    {
      "type": "CVSS_V3",
      "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
    }
  ],
  "affected": [
    {
      "package": {
        "ecosystem": "Raspberry Pi OS:12",
        "name": "linux"
      },
      "versions": [
        "1:6.1.47-1+rpt4"
      ],
      "ecosystem_specific": {
        "binaries": [
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-2712",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v6",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v7",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v7l",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v8",
            "binary_version": "1:6.1.47-1+rpt4"
          }
        ]
      },
      "database_specific": {
        "per_version": {
          "1:6.1.47-1+rpt4": {
            "linux_commit": "655fc658a15ae7a6f37103754adb39ba52a9a14e",
            "upstream_version": "6.1.47",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.1.110",
            "compiled_filter": false
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2024-46830"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/5f35099fa3d59caf10bda88b033538e90086684e"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/fa297c33faefe51e10244e8a378837fca4963228"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/939375737b5a0b1bf9b1e75129054e11bc9ca65e"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/ecdbe8ac86fb5538ccc623a41f88ec96c7168ab9"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/4bcdd831d9d01e0fb64faea50732b59b2ee88da1"
    }
  ],
  "database_specific": {
    "source": "https://git.kernel.org/pub/scm/linux/security/vulns.git",
    "upstream_modified": "2026-08-05T11:52:36Z",
    "severity": {
      "source": "kernel CNA",
      "cvss_v3_score": 7.8,
      "cvss_v3_severity": "High",
      "scenario": "AV:L - The vulnerability is reached solely through ioctls on a KVM vCPU file descriptor (`KVM_SET_NESTED_STATE` then `KVM_SET_VCPU_EVENTS`), racing against `KVM_SET_USER_MEMORY_REGION` on the VM fd. This requires local access to /dev/kvm with no network component.\nAC:L - The attacker owns both sides of the race \u2014 one thread toggles SMM via KVM_SET_VCPU_EVENTS while another deletes/moves memslots \u2014 and the two paths take disjoint locks (vcpu->mutex vs kvm->slots_lock). Because the unprotected read is a __copy_from_user() on the attacker's own guest mapping, userfaultfd/FUSE backing can stall the reader inside the window indefinitely, making the race deterministically winnable.\nPR:L - Only an open /dev/kvm descriptor is needed, which systemd's default udev rule grants world read/write (MODE=0666), and nested-virt CI runners, cloud images, and Android AVF routinely expose KVM to unprivileged users. No CAP_SYS_ADMIN or real root is required.\nUI:N - The attacker's own process performs every step \u2014 creating the VM, stuffing nested state, toggling SMM, and cycling memslots. No action by any other user is involved.\nS:U - The attacker is already host userspace and the impact is on the host kernel, so no security boundary is crossed; this is not a guest-to-host escape since guest-initiated SMM transitions go through KVM_RUN, which already holds SRCU. Vulnerable and impacted components share the same security authority.\nC:H - The missing SRCU read lock yields a use-after-free read of a kfree()'d struct kvm_memory_slot and of rbtree nodes in search_memslots(), and a reallocated slot gives the attacker control of userspace_addr/base_gfn/npages plus arch.rmap pointers. This permits reading memory of deleted regions and, via heap grooming, arbitrary kernel-memory disclosure.\nI:H - A freed slot that is reallocated with attacker-groomed contents is used to compute host addresses and is consumed by KVM's MMU and nested_vmx_load_msr(), and the concurrently-mutated rbtree traversal writes back into slots->last_used_slot. This gives the corruption-and-control-flow primitives characteristic of an exploitable heap UAF.\nA:H - Dereferencing freed memslot objects and walking an rbtree whose nodes are being freed under the reader reliably produces wild-pointer dereferences, oopses, and kernel panics. Any local user with /dev/kvm can trigger this in a loop to crash the host."
    }
  }
}
