{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2026-89763",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2026-89763"
  ],
  "published": "2026-09-11T19:47:07Z",
  "summary": "KEYS: trusted: Fix TPM teardown ordering",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nKEYS: trusted: Fix TPM teardown ordering\n\ntrusted_tpm_exit() drops the TPM chip reference and frees the digest\narray before unregistering the trusted key type. key_type_lookup()\nholds key_types_sem for reading until the key operation finishes, while\nunregister_key_type() takes it for writing. It therefore provides the\nsynchronization point that must precede backend teardown.\n\nThe current order permits this interleaving:\n\n  CPU 0                              CPU 1\n  trusted_tpm_exit()                 key_type_lookup(\"trusted\")\n    put_device(&chip->dev)             trusted_tpm_seal()\n    kfree(digests)                       pcrlock()\n    unregister_key_type()                  tpm_pcr_extend(..., digests)\n\nCPU 1 can consequently dereference the freed digest array. The chip can\nalso be released before callbacks stop using it.\n\nKASAN reported:\n\n  BUG: KASAN: slab-use-after-free in tpm_pcr_extend+0x1f0/0x200\n  Read of size 2 at addr ffff88810872d000 by task poc/89\n  Call Trace:\n    tpm_pcr_extend+0x1f0/0x200\n    pcrlock+0x42/0x70 [trusted]\n    trusted_tpm_seal+0x1b6/0x570 [trusted]\n    trusted_instantiate+0x293/0x340 [trusted]\n    __key_instantiate_and_link+0xb2/0x2b0\n    __key_create_or_update+0x61e/0xb50\n    __do_sys_add_key+0x1b8/0x310\n  Allocated by task 88:\n    __kmalloc_noprof+0x1a7/0x490\n    do_one_initcall+0xa1/0x390\n    do_init_module+0x2df/0x840\n  Freed by task 90:\n    kfree+0x131/0x3c0\n    trusted_tpm_exit+0x59/0xa0 [trusted]\n    __do_sys_delete_module+0x346/0x510\n\nMove unregister_key_type() before releasing either resource. This stops\nnew lookups and waits for in-flight key operations to finish before the\nbackend state is destroyed.",
  "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": null,
            "compiled_filter": false
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2026-89763"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/3d67b4acbfc7af331d887a8efc04bef6573b8a7a"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/753c978f2400f9783eb524842a975d3ac950d511"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/2f7541afbc57fe9d26769a22c31d8ce8790c9a19"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/5e2d672280d97d83de43031d93761b12dadd7b8a"
    }
  ],
  "database_specific": {
    "source": "https://git.kernel.org/pub/scm/linux/security/vulns.git",
    "upstream_modified": "2026-09-21T13:30:03Z",
    "severity": {
      "source": "kernel CNA",
      "cvss_v3_score": 7.8,
      "cvss_v3_severity": "High",
      "scenario": "AV:L - The UAF is reached only via the local add_key(2) syscall (trusted_instantiate \u2192 trusted_tpm_seal \u2192 pcrlock/tpm_* on global chip/digests) racing trusted_tpm_exit() during delete_module of trusted.ko; no network or adjacent protocol processes this key-type teardown.\nAC:L - The attacker controls both sides of the race by issuing concurrent add_key(\"trusted\") while trusted.ko is unloaded; key_type_lookup() still succeeds until unregister_key_type(), so the documented CPU0/CPU1 interleaving is reliably repeatable without uncontrollable victim memory layout.\nPR:L - add_key(2) on a caller-owned keyring has no capable() check in trusted_instantiate(); every seal/unseal uses the global chip after put_device, and only optional pcrlock() needs CAP_SYS_ADMIN. Per CNA driver-removal UAF precedent, concurrent rmmod of trusted.ko does not require the attacker to hold CAP_SYS_MODULE.\nUI:N - Exploitation is driven by the attacker's own add_key threads and module-unload timing; no separate victim must mount a filesystem, open a device, or take any other action.\nS:U - The vulnerability is a standard in-kernel slab use-after-free affecting host kernel memory and availability; it does not cross a VM, IOMMU, or other distinct security-authority boundary.\nC:H - KASAN shows a slab-use-after-free read of the freed digests array in tpm_pcr_extend, and put_device may free tpm_chip while callbacks still dereference it; per kernel CNA guidance a UAF enables object reuse and arbitrary kernel read, so Confidentiality is High.\nI:H - Seal/unseal after teardown calls tpm_try_get_ops() which mutates chip (get_device, mutex_lock) and PCR extend consumes the UAF'd digest buffer; use-after-free is heap-sprayable into write and control-flow primitives, so Integrity is High.\nA:H - The KASAN report is a kernel slab-use-after-free oops during add_key versus delete_module; any such UAF can panic or hang the kernel, scoring Availability High even when not fully exploited for code execution."
    }
  }
}
