# CVE-2026-46213: HID: appletb-kbd: fix UAF in inactivity-timer cleanup path

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.17% (percentile 4, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2026-05-28T09:40:30.429Z
- **Modified:** 2026-06-17T10:53:19.853Z

## Who should check

- Anyone running Linux \>= 38224c472a038fa9ccd4085511dd9f3d6119dbf9, \< 59a79938ca5541fe55d675304116b7ea684afef0; \>= 38224c472a038fa9ccd4085511dd9f3d6119dbf9, \< 93d989e47bc316c793a69c6a332e053c90e29f02; \>= 38224c472a038fa9ccd4085511dd9f3d6119dbf9, \< 4db2af929279c799b5653a39eb0795c72baffca4; 51720dee3a61ebace36c3dcdd0b4a488e0970f29; \>= 6.15.6, \< 6.16
- Anyone running Linux 6.16

## Description

In the Linux kernel, the following vulnerability has been resolved:

HID: appletb-kbd: fix UAF in inactivity-timer cleanup path

Commit 38224c472a03 ("HID: appletb-kbd: fix slab use-after-free bug in
appletb\_kbd\_probe") added timer\_delete\_sync(&kbd-\>inactivity\_timer) to
both the probe close\_hw error path and appletb\_kbd\_remove(), but the
way it was wired in left the inactivity timer reachable during driver
tear-down via two distinct windows.

Window A -- put\_device() before timer\_delete\_sync():

	put\_device(&kbd-\>backlight\_dev-\>dev);
	timer\_delete\_sync(&kbd-\>inactivity\_timer);

The inactivity\_timer softirq reads kbd-\>backlight\_dev and calls
backlight\_device\_set\_brightness() -\> mutex\_lock(&ops\_lock).  If a
concurrent hid\_appletb\_bl unbind drops the last devm reference
between these two calls, the backlight\_device is freed and the
mutex\_lock() touches freed memory.

Window B -- backlight cleanup before hid\_hw\_stop():

	if (kbd-\>backlight\_dev) {
		timer\_delete\_sync(...);
		put\_device(...);
	}
	hid\_hw\_close(hdev);
	hid\_hw\_stop(hdev);

Even after Window A is closed, hid\_hw\_close()/hid\_hw\_stop() still run
afterwards, so a late ".event" callback from the HID core (USB URB
completion on real Apple hardware) can arrive after
timer\_delete\_sync() drained the softirq but before put\_device() drops
the reference.  That callback reaches reset\_inactivity\_timer(), which
calls mod\_timer() and re-arms the timer.  The freshly re-armed timer
can then fire on the about-to-be-freed backlight\_device.

Both windows produce the same KASAN slab-use-after-free:

  BUG: KASAN: slab-use-after-free in \_\_mutex\_lock+0x1aab/0x21c0
  Read of size 8 at addr ffff88803ee9a108 by task swapper/0/0
  Call Trace:
   \<IRQ\>
   \_\_mutex\_lock
   backlight\_device\_set\_brightness
   appletb\_inactivity\_timer
   call\_timer\_fn
   run\_timer\_softirq
   handle\_softirqs
  Allocated by task N:
   devm\_backlight\_device\_register
   appletb\_bl\_probe
  Freed by task M:
   (concurrent hid\_appletb\_bl unbind path)

Close both windows at once by reworking the tear-down in
appletb\_kbd\_remove() and in the probe close\_hw error path so that

 1) hid\_hw\_close()/hid\_hw\_stop() run before the backlight cleanup,
    guaranteeing no further .event callback can fire and re-arm the
    timer, and
 2) inside the "if (kbd-\>backlight\_dev)" block, timer\_delete\_sync()
    runs before put\_device(), so the softirq is drained before the
    final reference is dropped.

## Affected and fixed versions

- Linux: \>= 38224c472a038fa9ccd4085511dd9f3d6119dbf9, \< 59a79938ca5541fe55d675304116b7ea684afef0; \>= 38224c472a038fa9ccd4085511dd9f3d6119dbf9, \< 93d989e47bc316c793a69c6a332e053c90e29f02; \>= 38224c472a038fa9ccd4085511dd9f3d6119dbf9, \< 4db2af929279c799b5653a39eb0795c72baffca4; 51720dee3a61ebace36c3dcdd0b4a488e0970f29; \>= 6.15.6, \< 6.16 (cvelist)
- Linux: 6.16 (cvelist)

## Mitigation

- Upgrade Linux to 6.16 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-46213. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-46213.md
Affected: Linux >= 38224c472a038fa9ccd4085511dd9f3d6119dbf9, < 59a79938ca5541fe55d675304116b7ea684afef0; >= 38224c472a038fa9ccd4085511dd9f3d6119dbf9, < 93d989e47bc316c793a69c6a332e053c90e29f02; >= 38224c472a038fa9ccd4085511dd9f3d6119dbf9, < 4db2af929279c799b5653a39eb0795c72baffca4; 51720dee3a61ebace36c3dcdd0…
Fixed in: Linux 59a79938ca5541fe55d675304116b7ea684afef0, Linux 93d989e47bc316c793a69c6a332e053c90e29f02, Linux 4db2af929279c799b5653a39eb0795c72baffca4, Linux 6.16

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-46213 being exploited?

There is no confirmed exploitation: CVE-2026-46213 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.17% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2026-46213?

High: CVSS 7.8 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2026-46213?

Linux \>= 38224c472a038fa9ccd4085511dd9f3d6119dbf9, \< 59a79938ca5541fe55d675304116b7ea684afef0; \>= 38224c472a038fa9ccd4085511dd9f3d6119dbf9, \< 93d989e47bc316c793a69c6a332e053c90e29f02; \>= 38224c472a038fa9ccd4085511dd9f3d6119dbf9, \< 4db2af929279c799b5653a39eb0795c72baffca4; 51720dee3a61ebace36c3dcdd0b4a488e0970f29; \>= 6.15.6, \< 6.16; Linux 6.16.

### Is there a fix for CVE-2026-46213?

Yes. Fixed in Linux 59a79938ca5541fe55d675304116b7ea684afef0, Linux 93d989e47bc316c793a69c6a332e053c90e29f02, Linux 4db2af929279c799b5653a39eb0795c72baffca4, Linux 6.16. Upgrade Linux to 6.16 or later.

### How do I check if I'm affected by CVE-2026-46213?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/59a79938ca5541fe55d675304116b7ea684afef0>
- patch: <https://git.kernel.org/stable/c/93d989e47bc316c793a69c6a332e053c90e29f02>
- patch: <https://git.kernel.org/stable/c/4db2af929279c799b5653a39eb0795c72baffca4>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-46213>

HTML: <https://flawdb.com/CVE-2026-46213> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-46213>
