{"api_version":"1","generated_at":"2026-05-30T23:21:25+00:00","cve":"CVE-2026-46213","urls":{"html":"https://cve.report/CVE-2026-46213","api":"https://cve.report/api/cve/CVE-2026-46213.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2026-46213","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-46213"},"summary":{"title":"HID: appletb-kbd: fix UAF in inactivity-timer cleanup path","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(&kbd->inactivity_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(&kbd->backlight_dev->dev);\n\ttimer_delete_sync(&kbd->inactivity_timer);\n\nThe inactivity_timer softirq reads kbd->backlight_dev and calls\nbacklight_device_set_brightness() -> mutex_lock(&ops_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->backlight_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   <IRQ>\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->backlight_dev)\" block, timer_delete_sync()\n    runs before put_device(), so the softirq is drained before the\n    final reference is dropped.","state":"PUBLISHED","assigner":"Linux","published_at":"2026-05-28 10:16:36","updated_at":"2026-05-28 13:44:01"},"problem_types":[],"metrics":[],"references":[{"url":"https://git.kernel.org/stable/c/93d989e47bc316c793a69c6a332e053c90e29f02","name":"https://git.kernel.org/stable/c/93d989e47bc316c793a69c6a332e053c90e29f02","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/4db2af929279c799b5653a39eb0795c72baffca4","name":"https://git.kernel.org/stable/c/4db2af929279c799b5653a39eb0795c72baffca4","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/59a79938ca5541fe55d675304116b7ea684afef0","name":"https://git.kernel.org/stable/c/59a79938ca5541fe55d675304116b7ea684afef0","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-46213","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-46213","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 38224c472a038fa9ccd4085511dd9f3d6119dbf9 59a79938ca5541fe55d675304116b7ea684afef0 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 38224c472a038fa9ccd4085511dd9f3d6119dbf9 93d989e47bc316c793a69c6a332e053c90e29f02 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 38224c472a038fa9ccd4085511dd9f3d6119dbf9 4db2af929279c799b5653a39eb0795c72baffca4 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 51720dee3a61ebace36c3dcdd0b4a488e0970f29 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 6.15.6 6.16 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 6.16","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.16 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.18.32 6.18.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.0.9 7.0.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.1-rc4 * original_commit_for_fix","platforms":[]}],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[],"nvd_cpes":[],"vendor_comments":[],"enrichments":{"kev":null,"epss":{"cve_year":"2026","cve_id":"46213","cve":"CVE-2026-46213","epss":"0.000170000","percentile":"0.043360000","score_date":"2026-05-29","updated_at":"2026-05-30 00:13:24"},"legacy_qids":[]},"source_records":{"cve_program":{"containers":{"cna":{"affected":[{"defaultStatus":"unaffected","product":"Linux","programFiles":["drivers/hid/hid-appletb-kbd.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"lessThan":"59a79938ca5541fe55d675304116b7ea684afef0","status":"affected","version":"38224c472a038fa9ccd4085511dd9f3d6119dbf9","versionType":"git"},{"lessThan":"93d989e47bc316c793a69c6a332e053c90e29f02","status":"affected","version":"38224c472a038fa9ccd4085511dd9f3d6119dbf9","versionType":"git"},{"lessThan":"4db2af929279c799b5653a39eb0795c72baffca4","status":"affected","version":"38224c472a038fa9ccd4085511dd9f3d6119dbf9","versionType":"git"},{"status":"affected","version":"51720dee3a61ebace36c3dcdd0b4a488e0970f29","versionType":"git"},{"lessThan":"6.16","status":"affected","version":"6.15.6","versionType":"semver"}]},{"defaultStatus":"affected","product":"Linux","programFiles":["drivers/hid/hid-appletb-kbd.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"status":"affected","version":"6.16"},{"lessThan":"6.16","status":"unaffected","version":"0","versionType":"semver"},{"lessThanOrEqual":"6.18.*","status":"unaffected","version":"6.18.32","versionType":"semver"},{"lessThanOrEqual":"7.0.*","status":"unaffected","version":"7.0.9","versionType":"semver"},{"lessThanOrEqual":"*","status":"unaffected","version":"7.1-rc4","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.18.32","versionStartIncluding":"6.16","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.0.9","versionStartIncluding":"6.16","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.1-rc4","versionStartIncluding":"6.16","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.15.6","vulnerable":true}],"negate":false,"operator":"OR"}]}],"descriptions":[{"lang":"en","value":"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(&kbd->inactivity_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(&kbd->backlight_dev->dev);\n\ttimer_delete_sync(&kbd->inactivity_timer);\n\nThe inactivity_timer softirq reads kbd->backlight_dev and calls\nbacklight_device_set_brightness() -> mutex_lock(&ops_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->backlight_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   <IRQ>\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->backlight_dev)\" block, timer_delete_sync()\n    runs before put_device(), so the softirq is drained before the\n    final reference is dropped."}],"providerMetadata":{"dateUpdated":"2026-05-28T09:40:30.429Z","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux"},"references":[{"url":"https://git.kernel.org/stable/c/59a79938ca5541fe55d675304116b7ea684afef0"},{"url":"https://git.kernel.org/stable/c/93d989e47bc316c793a69c6a332e053c90e29f02"},{"url":"https://git.kernel.org/stable/c/4db2af929279c799b5653a39eb0795c72baffca4"}],"title":"HID: appletb-kbd: fix UAF in inactivity-timer cleanup path","x_generator":{"engine":"bippy-1.2.0"}}},"cveMetadata":{"assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","assignerShortName":"Linux","cveId":"CVE-2026-46213","datePublished":"2026-05-28T09:40:30.429Z","dateReserved":"2026-05-13T15:03:33.105Z","dateUpdated":"2026-05-28T09:40:30.429Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"},"nvd":{"publishedDate":"2026-05-28 10:16:36","lastModifiedDate":"2026-05-28 13:44:01","problem_types":[],"metrics":[],"configurations":[]},"legacy_mitre":{"record":{"CveYear":"2026","CveId":"46213","Ordinal":"1","Title":"HID: appletb-kbd: fix UAF in inactivity-timer cleanup path","CVE":"CVE-2026-46213","Year":"2026"},"notes":[{"CveYear":"2026","CveId":"46213","Ordinal":"1","NoteData":"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(&kbd->inactivity_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(&kbd->backlight_dev->dev);\n\ttimer_delete_sync(&kbd->inactivity_timer);\n\nThe inactivity_timer softirq reads kbd->backlight_dev and calls\nbacklight_device_set_brightness() -> mutex_lock(&ops_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->backlight_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   <IRQ>\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->backlight_dev)\" block, timer_delete_sync()\n    runs before put_device(), so the softirq is drained before the\n    final reference is dropped.","Type":"Description","Title":"HID: appletb-kbd: fix UAF in inactivity-timer cleanup path"}]}}}