{
  "id": "CVE-2026-46213",
  "url": "https://poc.griffinguard.io/cve/CVE-2026-46213",
  "published_at": "2026-05-28T09:40:30.429Z",
  "title": "HID: appletb-kbd: fix UAF in inactivity-timer cleanup path",
  "vendor": "Linux",
  "product": "Linux",
  "cvss": {
    "score": 7.8,
    "source": "nvd",
    "vector": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  },
  "kev": {
    "in_kev": false,
    "added_at": null,
    "days_after_publication": null
  },
  "first_poc": null,
  "poc_repo_count": 0,
  "exploit_count": 0,
  "suspicious_repo_count": 0,
  "edge_device": null,
  "description": "In the Linux kernel, the following vulnerability has been resolved:\n\nHID: appletb-kbd: fix UAF in inactivity-timer cleanup path\n\nCommit 38224c472a03 (\"HID: appletb-kbd: fix slab use-after-free bug in\nappletb_kbd_probe\") added timer_delete_sync(\u0026kbd-\u003einactivity_timer) to\nboth the probe close_hw error path and appletb_kbd_remove(), but the\nway it was wired in left the inactivity timer reachable during driver\ntear-down via two distinct windows.\n\nWindow A -- put_device() before timer_delete_sync():\n\n\tput_device(\u0026kbd-\u003ebacklight_dev-\u003edev);\n\ttimer_delete_sync(\u0026kbd-\u003einactivity_timer);\n\nThe inactivity_timer softirq reads kbd-\u003ebacklight_dev and calls\nbacklight_device_set_brightness() -\u003e mutex_lock(\u0026ops_lock).  If a\nconcurrent hid_appletb_bl unbind drops the last devm reference\nbetween these two calls, the backlight_device is freed and the\nmutex_lock() touches freed memory.\n\nWindow B -- backlight cleanup before hid_hw_stop():\n\n\tif (kbd-\u003ebacklight_dev) {\n\t\ttimer_delete_sync(...);\n\t\tput_device(...);\n\t}\n\thid_hw_close(hdev);\n\thid_hw_stop(hdev);\n\nEven after Window A is closed, hid_hw_close()/hid_hw_stop() still run\nafterwards, so a late \".event\" callback from the HID core (USB URB\ncompletion on real Apple hardware) can arrive after\ntimer_delete_sync() drained the softirq but before put_device() drops\nthe reference.  That callback reaches reset_inactivity_timer(), which\ncalls mod_timer() and re-arms the timer.  The freshly re-armed timer\ncan then fire on the about-to-be-freed backlight_device.\n\nBoth windows produce the same KASAN slab-use-after-free:\n\n  BUG: KASAN: slab-use-after-free in __mutex_lock+0x1aab/0x21c0\n  Read of size 8 at addr ffff88803ee9a108 by task swapper/0/0\n  Call Trace:\n   \u003cIRQ\u003e\n   __mutex_lock\n   backlight_device_set_brightness\n   appletb_inactivity_timer\n   call_timer_fn\n   run_timer_softirq\n   handle_softirqs\n  Allocated by task N:\n   devm_backlight_device_register\n   appletb_bl_probe\n  Freed by task M:\n   (concurrent hid_appletb_bl unbind path)\n\nClose both windows at once by reworking the tear-down in\nappletb_kbd_remove() and in the probe close_hw error path so that\n\n 1) hid_hw_close()/hid_hw_stop() run before the backlight cleanup,\n    guaranteeing no further .event callback can fire and re-arm the\n    timer, and\n 2) inside the \"if (kbd-\u003ebacklight_dev)\" block, timer_delete_sync()\n    runs before put_device(), so the softirq is drained before the\n    final reference is dropped.",
  "cwe": "CWE-416",
  "cpes": [
    "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
    "cpe:2.3:o:linux:linux_kernel:6.16:-:*:*:*:*:*:*",
    "cpe:2.3:o:linux:linux_kernel:6.16:rc5:*:*:*:*:*:*",
    "cpe:2.3:o:linux:linux_kernel:6.16:rc6:*:*:*:*:*:*",
    "cpe:2.3:o:linux:linux_kernel:6.16:rc7:*:*:*:*:*:*",
    "cpe:2.3:o:linux:linux_kernel:7.1:rc1:*:*:*:*:*:*",
    "cpe:2.3:o:linux:linux_kernel:7.1:rc2:*:*:*:*:*:*",
    "cpe:2.3:o:linux:linux_kernel:7.1:rc3:*:*:*:*:*:*"
  ],
  "cvss_by_source": {
    "nvd": 7.8
  },
  "repos": [],
  "remediation": {
    "affected": [
      {
        "vendor": "Linux",
        "product": "Linux",
        "ranges": [
          "\u003e= 38224c472a038fa9ccd4085511dd9f3d6119dbf9, \u003c 59a79938ca5541fe55d675304116b7ea684afef0",
          "\u003e= 38224c472a038fa9ccd4085511dd9f3d6119dbf9, \u003c 93d989e47bc316c793a69c6a332e053c90e29f02",
          "\u003e= 38224c472a038fa9ccd4085511dd9f3d6119dbf9, \u003c 4db2af929279c799b5653a39eb0795c72baffca4",
          "51720dee3a61ebace36c3dcdd0b4a488e0970f29",
          "\u003e= 6.15.6, \u003c 6.16"
        ],
        "fixed_in": [
          "59a79938ca5541fe55d675304116b7ea684afef0",
          "93d989e47bc316c793a69c6a332e053c90e29f02",
          "4db2af929279c799b5653a39eb0795c72baffca4",
          "6.16"
        ]
      },
      {
        "vendor": "Linux",
        "product": "Linux",
        "ranges": [
          "6.16"
        ],
        "fixed_in": [
          "0",
          "6.18.32",
          "7.0.9",
          "7.1"
        ]
      }
    ],
    "upgrade": [
      "Upgrade Linux to 59a79938ca5541fe55d675304116b7ea684afef0 or 93d989e47bc316c793a69c6a332e053c90e29f02 or 4db2af929279c799b5653a39eb0795c72baffca4 or 6.16 or later.",
      "Upgrade Linux to 0 or 6.18.32 or 7.0.9 or 7.1 or later."
    ]
  },
  "exploit_refs": [],
  "hunt_profile": [],
  "rules": []
}
