{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2026-98283",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2026-98283"
  ],
  "published": "2026-10-06T08:47:10Z",
  "summary": "KVM: PPC: Book3S HV: fix use-after-free in kvmhv_emulate_tlbie_all_lpid()",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nKVM: PPC: Book3S HV: fix use-after-free in kvmhv_emulate_tlbie_all_lpid()\n\nkvmhv_emulate_tlbie_all_lpid() iterates the nested-guest IDR and drops\nmmu_lock before calling kvmhv_emulate_tlbie_lpid(), but does not hold a\nreference on the kvm_nested_guest pointer obtained from the IDR.  A\nconcurrent vCPU issuing a single-LPID tlbie (is=2, ric=2) can race\nthrough kvmhv_flush_nested() -> kvmhv_remove_nested() -> idr_remove /\n--refcnt -> kvmhv_release_nested() -> kfree(gp) in that window, leaving\nthe iterating vCPU with a dangling pointer.  The subsequent\nmutex_lock(&gp->tlb_lock) and accesses to gp->shadow_pgtable,\ngp->shadow_lpid and gp->l1_host all touch freed memory.  The free path\nis fully L1-controlled.\n\nFix this by incrementing gp->refcnt inside the loop before dropping\nmmu_lock, mirroring what kvmhv_get_nested() does, and releasing the\nreference with kvmhv_put_nested() after the per-guest work completes.\nThis is the same get/put discipline already used at every other\ncall site that drops mmu_lock while holding a nested-guest pointer.",
  "severity": [
    {
      "type": "CVSS_V3",
      "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/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.189",
            "compiled_filter": false
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2026-98283"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/4d8f7b1f586375df8bce23a0909566ad5e852259"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/e37fba1ba69385cff2d0e60b371ee19e7d1852d1"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/24b634852413229bb8340d908b115c3365f3a247"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/fbf69b7d0555ee83c871f58750770f74b7179ad1"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/ec2d7a52b3996ae81131617b4afc0af31583c1b4"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/51938dfa8a51a4f85328413fca9b6e21f9d2d088"
    }
  ],
  "database_specific": {
    "source": "https://git.kernel.org/pub/scm/linux/security/vulns.git",
    "upstream_modified": "2026-10-07T06:50:27Z",
    "severity": {
      "source": "kernel CNA",
      "cvss_v3_score": 8.8,
      "cvss_v3_severity": "High",
      "scenario": "AV:L - The trigger is the H_TLB_INVALIDATE hcall made by code running inside an L1 guest on the POWER KVM-HV host, via kvmppc_pseries_do_hcall -> kvmhv_do_nested_tlbie -> kvmhv_emulate_priv_tlbie -> kvmhv_emulate_tlbie_all_lpid. No network protocol carries the input; the attacker needs code execution in a local guest.\nAC:L - The L1 controls both sides of the race: one vCPU issues tlbie is=3 (all-LPID walk), another issues is=2 ric=2 after zeroing its own partition-table entry so kvmhv_flush_nested() calls kvmhv_remove_nested() and kfree(gp). Contention on gp->tlb_lock widens the window and the attempt can be repeated. The only outside requirement is the VMM enabling KVM_CAP_PPC_NESTED_HV.\nPR:L - The attacker needs kernel/hypervisor-mode code in a nested-enabled L1 guest, which an ordinary tenant owns, but holds no privilege on the L0 host. The nesting_enabled() check is the only gate before kvmhv_do_nested_tlbie().\nUI:N - The L1 guest issues every hcall and controls every partition-table entry involved. No host operator or other user has to do anything.\nS:C - A guest-controlled vulnerability corrupts memory in the L0 host kernel (the kfree'd kvm_nested_guest object), which crosses the guest-to-host boundary.\nC:H - After the free, kvmhv_emulate_tlbie_lpid() reads gp->shadow_pgtable, gp->shadow_lpid and gp->l1_host from the dangling object. A reclaimed object lets the guest steer host page-table walks and host data reads.\nI:H - The freed gp is used for mutex_lock(&gp->tlb_lock), kvmppc_free_pgtable_radix() on gp->shadow_pgtable, and kvmhv_flush_nested()/kvmhv_put_nested() refcount writes. With a reclaimed object, these become host-kernel write and free primitives the guest controls.\nA:H - Using the freed kvm_nested_guest in the host can oops or panic the L0 host kernel, taking down every guest on the machine. The L1 can trigger it again at will."
    }
  }
}
