製品・ソフトウェアに関する情報
LinuxのLinux Kernelにおける解放済みメモリの使用に関する脆弱性
Title LinuxのLinux Kernelにおける解放済みメモリの使用に関する脆弱性
Summary

Linuxカーネルにおいて、以下の脆弱性が修正されました。HID: appletb-kbdにおける非アクティブタイマーのクリーンアップパスに関するUse-After-Free(UAF)の問題です。修正はCommit 38224c472a03("HID: appletb-kbd: fix slab use-after-free bug in appletb_kbd_probe")で行われ、probeのclose_hwエラーパスとappletb_kbd_remove()の両方にtimer_delete_sync(&kbd-inactivity_timer)が追加されました。しかし、その結線方法によりドライバーの停止時に非アクティブタイマーが二つの異なるタイミングで到達可能な状態が残っていました。ウィンドウAでは、timer_delete_sync()の前にput_device()が呼ばれます(put_device(&kbd-backlight_dev-dev)の後にtimer_delete_sync(&kbd-inactivity_timer))。inactivity_timerのsoftirqはkbd-backlight_devを読み取り、backlight_device_set_brightness()を呼び出し、その中でmutex_lock(&ops_lock)が呼ばれます。もし同時にhid_appletb_blのunbindがこれら二つの呼び出しの間で最後のdevm参照を解放すると、backlight_deviceが解放され、mutex_lock()が解放済みメモリにアクセスする危険があります。ウィンドウBでは、backlightクリーンアップがhid_hw_stop()の前に実行されます。具体的には、if (kbd-backlight_dev) {timer_delete_sync(...); put_device(...);}の後にhid_hw_close(hdev)およびhid_hw_stop(hdev)が呼び出されます。ウィンドウAが閉じられてもhid_hw_close()/hid_hw_stop()はその後も実行されるため、HIDコアの遅延した"event"コールバック(実機Appleハードウェア上のUSB URB完了)がtimer_delete_sync()でsoftirqが消費されたあとで、かつput_device()で最後の参照が解放される前に到着する可能性があります。そのコールバックはreset_inactivity_timer()に達し、mod_timer()を呼び出してタイマーを再起動します。再起動されたタイマーは、まさに解放されようとしているbacklight_device上で発火する恐れがあります。両方のウィンドウは同じKASAN slab-use-after-freeエラーを引き起こしています。具体的には、BUG: KASAN: slab-use-after-free in __mutex_lock+0x1aab/0x21c0、アクセスサイズ8、アドレスffff88803ee9a108、タスクswapper/0/0による読み取りが発生し、呼び出しトレースはIRQ __mutex_lock backlight_device_set_brightness appletb_inactivity_timer call_timer_fn run_timer_softirq handle_softirqsです。割り当てたタスクNはdevm_backlight_device_registerおよびappletb_bl_probeであり、解放したタスクMは同時に発生するhid_appletb_bl unbindパスです。これら両方のウィンドウを同時に閉じるため、appletb_kbd_remove()およびprobeのclose_hwエラーパスでの停止手続きを再設計しました。具体的には、1) backlightクリーンアップの前にhid_hw_close()/hid_hw_stop()を実行して、その後に"event"コールバックによるタイマー再起動が発生しないことを保証し、2) "if (kbd-backlight_dev)"ブロック内でtimer_delete_sync()をput_device()より先に実行し、softirqが最終参照解放前に消費されるようにしました。

Possible impacts ・当該ソフトウェアが扱う全ての情報が外部に漏れる可能性があります。 ・当該ソフトウェアが扱う全ての情報が書き換えられる可能性があります。 ・当該ソフトウェアが完全に停止する可能性があります。 
Solution

リリース情報、またはパッチ情報が公開されています。参考情報を参照して適切な対策を実施してください。

Publication Date May 28, 2026, midnight
Registration Date June 11, 2026, 4:21 p.m.
Last Update June 11, 2026, 4:21 p.m.
CVSS3.0 : 重要
Score 7.8
Vector CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Affected System
Linux
Linux Kernel 6.16
Linux Kernel 6.16.1 以上 6.18.32 未満
Linux Kernel 6.19 以上 7.0.9 未満
Linux Kernel 7.1
Linux Kernel 6.15.6 以上 6.16 未満
CVE (情報セキュリティ 共通脆弱性識別子)
CWE (共通脆弱性タイプ一覧)
その他
Change Log
No Changed Details Date of change
1 [2026年06月11日]
  掲載
June 11, 2026, 4:21 p.m.

NVD Vulnerability Information
CVE-2026-46213
Summary

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.

Publication Date May 28, 2026, 7:16 p.m.
Registration Date May 29, 2026, 4:14 a.m.
Last Update May 28, 2026, 10:44 p.m.
Related information, measures and tools
Common Vulnerabilities List