🇰🇷 한글 설명
Linux 커널의 HID appletb-kbd 드라이버에서 타이머 및 IRQ 컨텍스트에서 뮤텍스 잠금을 호출하여 시스템 충돌을 유발하는 버그가 발견되었습니다. 이 취약점은 비적합한 컨텍스트에서 잠금 함수를 실행하여 커널 패닉을 일으킬 수 있습니다.
💡 쉬운 설명
키보드나 터치바 관련 드라이버가 잘못된 시점에 시스템 자원을 잠그려 해가 발생할 수 있습니다. 이는 시스템이 갑자기 멈추거나 재시작되는 원인이 됩니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
HID: appletb-kbd: run inactivity autodim from workqueues
The autodim code in hid-appletb-kbd takes backlight_device->ops_lock
via backlight_device_set_brightness() -> mutex_lock() from two
different atomic contexts:
* appletb_inactivity_timer() is a struct timer_list callback, so it
runs in softirq context. Every expiry triggers
BUG: sleeping function called from invalid context at kernel/locking/mutex.c:591
Call Trace:
<IRQ>
__might_resched
__mutex_lock
backlight_device_set_brightness
appletb_inactivity_timer
call_timer_fn
run_timer_softirq
* reset_inactivity_timer() is called from appletb_kbd_hid_event() and
appletb_kbd_inp_event(). On real USB hardware these run in
softirq/IRQ context (URB completion and input-event dispatch).
When the Touch Bar has already been dimmed or turned off, the
reset path calls backlight_device_set_brightness() directly to
restore brightness, producing the same warning.
Both call sites hit the same mutex_lock()-from-atomic bug. Fix them
together by moving the blocking work onto the system workqueue:
* Convert the inactivity timer from struct timer_list to
struct delayed_work; the callback (appletb_inactivity_work) now
runs in process context where mutex_lock() is legal.
* Add a dedicated struct work_struct restore_brightness_work and have
reset_inactivity_timer() schedule it instead of calling
backlight_device_set_brightness() directly.
Cancel both works synchronously during driver tear-down alongside the
existing backlight reference drop.
The semantics are unchanged (same delays, same state transitions on
dim, turn-off and user activity); only the execution context of the
sleeping call changes. The timer field and callback are renamed to
match their new type; reset_inactivity_timer() keeps its name because
it is invoked from input event paths that read naturally as "reset
the inactivity timer".
📍 영향받는 시스템
Linux kernel (hid-appletb-kbd 모듈이 포함된 버전)
⚔️ 공격 벡터
로컬 물리적 접근 또는 입력 이벤트 발생 시 자동 실행
🛡️ 대응 방법
Linux 커널을 최신 안정 버전으로 업데이트하거나 해당 드라이버 패치를 적용하십시오.
🔧 검증 코드
출력된 커널 버전이 패치가 적용된 최신 버전인지 확인하십시오.