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

Published May 28, 2026
·
Updated

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 appletbkbdprobe") added timerdeletesync(&kbd->inactivitytimer) to both the probe closehw error path and appletbkbdremove(), but the way it was wired in left the inactivity timer reachable during driver tear-down via two distinct windows.

Window A -- putdevice() before timerdeletesync():

putdevice(&kbd->backlightdev->dev); timerdeletesync(&kbd->inactivitytimer);

The inactivitytimer softirq reads kbd->backlightdev and calls backlightdevicesetbrightness() -> mutexlock(&opslock). If a concurrent hidappletbbl unbind drops the last devm reference between these two calls, the backlightdevice is freed and the mutexlock() touches freed memory.

Window B -- backlight cleanup before hidhwstop():

if (kbd->backlightdev) { timerdeletesync(...); putdevice(...); } hidhwclose(hdev); hidhwstop(hdev);

Even after Window A is closed, hidhwclose()/hidhwstop() still run afterwards, so a late ".event" callback from the HID core (USB URB completion on real Apple hardware) can arrive after timerdeletesync() drained the softirq but before putdevice() drops the reference. That callback reaches resetinactivitytimer(), which calls modtimer() and re-arms the timer. The freshly re-armed timer can then fire on the about-to-be-freed backlightdevice.

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

BUG: KASAN: slab-use-after-free in mutexlock+0x1aab/0x21c0 Read of size 8 at addr ffff88803ee9a108 by task swapper/0/0 Call Trace: <IRQ> mutexlock backlightdevicesetbrightness appletbinactivitytimer calltimerfn runtimersoftirq handlesoftirqs Allocated by task N: devmbacklightdeviceregister appletbblprobe Freed by task M: (concurrent hidappletbbl unbind path)

Close both windows at once by reworking the tear-down in appletbkbdremove() and in the probe closehw error path so that

1) hidhwclose()/hidhwstop() run before the backlight cleanup, guaranteeing no further .event callback can fire and re-arm the timer, and 2) inside the "if (kbd->backlightdev)" block, timerdeletesync() runs before putdevice(), so the softirq is drained before the final reference is dropped.

Affected Software

11 affected components
Linux Linux kernel (appletb-kbd)
Linux Linux kernel>=6.15.6<6.16
Linux Linux kernel>=6.16.1<6.18.32
Linux Linux kernel>=6.19<7.0.9
Linux Linux kernel=6.16
Linux Linux kernel=6.16-rc5
Linux Linux kernel=6.16-rc6
Linux Linux kernel=6.16-rc7
Linux Linux kernel=7.1-rc1
Linux Linux kernel=7.1-rc2
Linux Linux kernel=7.1-rc3

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Patch 38224c472a03
  2. Configuration

    Rework the driver teardown in appletb_kbd_remove() and the probe close_hw error path so that (1) hid_hw_close() and hid_hw_stop() are executed before performing backlight cleanup, preventing late .event callbacks from re-arming the inactivity timer, and (2) inside the 'if (kbd->backlight_dev)' block call timer_delete_sync(&kbd->inactivity_timer) before put_device(&kbd->backlight_dev->dev) to drain the softirq prior to dropping the final reference.

    appletb-kbd (Linux kernel HID driver) teardown ordering = run hid_hw_close()/hid_hw_stop() before backlight cleanup; call timer_delete_sync() before put_device() when kbd->backlight_dev is present

Event History

May 28, 2026
CVE Published
via MITRE·09:40 AM
Data Sourced
via MITRE·09:40 AM
Description
Data Sourced
via NVD·10:16 AM
RemedyDescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-46213?

CVE-2026-46213 has a risk score of 44, indicating a significant severity level.

2

How do I fix CVE-2026-46213?

To fix CVE-2026-46213, ensure you update to the latest version of the Linux kernel that includes the resolution for the use-after-free vulnerability.

3

What does CVE-2026-46213 affect?

CVE-2026-46213 specifically affects the appletb-kbd component of the Linux kernel.

4

What type of vulnerability is CVE-2026-46213?

CVE-2026-46213 is classified as a Use After Free (UAF) vulnerability.

5

When was CVE-2026-46213 published?

CVE-2026-46213 was published on May 28, 2026.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203