🇰🇷 한글 설명
리눅스 커널의 LED 백라이트 드라이버에서 devlink가 LED 클래스 장치를 공급자로 올바르게 인식하지 못하는 취약점이 발견되었습니다. 이로 인해 장치 제거 순서가 제대로 보장되지 않아, LED 드라이버가 백라이트 장치보다 먼저 제거될 경우 커널 NULL 포인터 역참조 오류가 발생할 수 있습니다.
💡 쉬운 설명
컴퓨터 화면 밝기를 조절하는 부품과 이를 제어하는 소프트웨어 사이의 연결 순서가 꼬이는 문제입니다. 이 때문에 부품을 제거할 때 소프트웨어가 잘못된 메모리 주소를 참조하여 시스템이 멈추거나 오류가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
backlight: led-bl: Add devlink to supplier LEDs
LED Backlight is a consumer of one or multiple LED class devices, but
devlink is currently unable to create correct supplier-producer links when
the supplier is a class device. It creates instead a link where the
supplier is the parent of the expected device.
One consequence is that removal order is not correctly enforced.
Issues happen for example with the following sections in a device tree
overlay:
// An LED driver chip
pca9632@62 {
compatible = "nxp,pca9632";
reg = <0x62>;
// ...
addon_led_pwm: led-pwm@3 {
reg = <3>;
label = "addon:led:pwm";
};
};
backlight-addon {
compatible = "led-backlight";
leds = <&addon_led_pwm>;
brightness-levels = <255>;
default-brightness-level = <255>;
};
In this example, the devlink should be created between the backlight-addon
(consumer) and the pca9632@62 (supplier). Instead it is created between the
backlight-addon (consumer) and the parent of the pca9632@62, which is
typically the I2C bus adapter.
On removal of the above overlay, the LED driver can be removed before the
backlight device, resulting in:
Unable to handle kernel NULL pointer dereference at virtual address 0000000000000010
...
Call trace:
led_put+0xe0/0x140
devm_led_release+0x6c/0x98
Another way to reproduce the bug without any device tree overlays is
unbinding the LED class device (pca9632@62) before unbinding the consumer
(backlight-addon):
echo 11-0062 >/sys/bus/i2c/drivers/leds-pca963x/unbind
echo ...backlight-dock >/sys/bus/platform/drivers/led-backlight/unbind
Fix by adding a devlink between the consuming led-backlight device and the
supplying LED device, as other drivers and subsystems do as well.
📍 영향받는 시스템
Linux Kernel (LED backlight subsystem 관련 버전)
⚔️ 공격 벡터
로컬 시스템에서 장치 트리 오버레이를 사용하거나 특정 드라이버를 강제로 언바인딩(Unbind)하여 발생 가능
🛡️ 대응 방법
LED 백라이트 장치와 공급 LED 장치 사이에 devlink를 추가하여 제거 순서를 보장하는 커널 패치 적용
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 수정된 최신 패치 버전인지 확인합니다.