CVE-2026-46202
Race Condition in Linux Kernel HID Appletb Keyboard Driver
Publication date: 2026-05-28
Last updated on: 2026-05-28
Assigner: kernel.org
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-UNKNOWN |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
This vulnerability exists in the Linux kernel's hid-appletb-kbd driver related to the handling of the Touch Bar's backlight brightness. The issue arises because the code attempts to acquire a mutex lock (ops_lock) from two different atomic contexts where sleeping is not allowed. Specifically, the inactivity autodim code calls backlight_device_set_brightness(), which tries to lock a mutex from softirq or IRQ contexts, leading to a BUG due to calling a sleeping function from an invalid context.
The problem occurs in two places: the inactivity timer callback (appletb_inactivity_timer) running in softirq context, and the reset_inactivity_timer function called from input event paths also running in atomic contexts. Both call backlight_device_set_brightness() directly, causing the mutex_lock-from-atomic bug.
The fix involved moving the blocking work to the system workqueue by converting the timer to delayed_work and scheduling brightness restoration work asynchronously. This ensures the mutex_lock() call happens in process context where sleeping is allowed, preventing the invalid context bug.
How can this vulnerability impact me? :
This vulnerability can cause kernel warnings and potentially kernel instability or crashes due to improper locking in atomic contexts. Specifically, calling a sleeping function like mutex_lock() from an atomic context can lead to BUG messages and may destabilize the system or cause unexpected behavior in the Touch Bar backlight functionality.
While the semantics of the backlight dimming and brightness restoration remain unchanged, the bug could affect system reliability and user experience by triggering kernel errors during normal input or inactivity events.
How can this vulnerability be detected on my network or system? Can you suggest some commands?
This vulnerability manifests as a kernel BUG triggered by a sleeping function called from an invalid atomic context. Detection involves monitoring kernel logs for specific BUG messages related to mutex_lock() called from atomic contexts in the hid-appletb-kbd driver.
You can check your system logs (e.g., dmesg or /var/log/kern.log) for messages similar to:
- BUG: sleeping function called from invalid context at kernel/locking/mutex.c:591
- Call Trace involving backlight_device_set_brightness and appletb_inactivity_timer or reset_inactivity_timer
Suggested commands to detect this issue include:
- dmesg | grep 'BUG: sleeping function called from invalid context'
- journalctl -k | grep 'backlight_device_set_brightness'
- grep -i 'appletb_inactivity_timer' /var/log/kern.log
What immediate steps should I take to mitigate this vulnerability?
The vulnerability is fixed by changing the execution context of the backlight brightness adjustment calls from atomic contexts to process context using workqueues.
Immediate mitigation steps include:
- Update the Linux kernel to a version that includes the fix which converts the inactivity timer from struct timer_list to struct delayed_work and schedules brightness restoration work on a system workqueue.
- Avoid using affected versions of the hid-appletb-kbd driver until patched.
- If updating is not immediately possible, monitor kernel logs for the BUG messages and consider disabling the affected driver or related features temporarily to prevent the bug from triggering.