🇰🇷 한글 설명
Linux 커널 hwmon acpi_power_meter 드라이버에서 acpi_power_meter_notify() 콜백이 장치 등록 해제 중 sysfs 속성 콜백과 충돌하는 데드락 문제가 있었습니다. 패치는 해제 작업을 락 외부로 옮기고, 알림 처리를 직렬화하는 새 뮤텍스를 추가하며, 등록 실패 시 에러 포인터 접근을 막는 검사를 넣었습니다.
💡 쉬운 설명
전력 측정 장치를 제거하는 동시에 장치 정보를 읽으려 하면 시스템이 멈출 수 있는 문제입니다. 수정으로 두 작업이 서로 엇갈리지 않도록 순서를 맞췄습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
hwmon: (acpi_power_meter) Fix deadlocks related to acpi_power_meter_notify()
The acpi_power_meter driver's .notify() callback function,
acpi_power_meter_notify(), calls hwmon_device_unregister() under a lock
that is also acquired by callbacks in sysfs attributes of the device
being unregistered which is prone to deadlocks between sysfs access and
device removal.
Address this by moving the hwmon device removal in
acpi_power_meter_notify() outside the lock in question, but notice
that doing it alone is not sufficient because two concurrent
METER_NOTIFY_CONFIG notifications may be attempting to remove the
same device at the same time. To prevent that from happening, add a
new lock serializing the execution of the switch () statement in
acpi_power_meter_notify(). For simplicity, it is a static mutex
which should not be a problem from the performance perspective.
The new lock also allows the hwmon_device_register_with_info()
in acpi_power_meter_notify() to be called outside the inner lock
because it prevents the other notifications handled by that function
from manipulating the "resource" object while the hwmon device based
on it is being registered. The sending of ACPI netlink messages from
acpi_power_meter_notify() is serialized by the new lock too which
generally helps to ensure that the order of handling firmware
notifications is the same as the order of sending netlink messages
related to them.
In addition, notice that hwmon_device_register_with_info() may fail
in which case resource->hwmon_dev will become an error pointer,
so add checks to avoid attempting to unregister the hwmon device
pointer to by it in that case to acpi_power_meter_notify() and
acpi_power_meter_remove().
📍 영향받는 시스템
ACPI 전력 미터(acpi_power_meter) 드라이버를 사용하는 Linux 커널 (수정 커널 이전 버전)
⚔️ 공격 벡터
로컬 사용자가 sysfs 속성을 반복 접근하면서 장치 알림(METER_NOTIFY_CONFIG)을 유발해 데드락으로 서비스 거부를 일으킬 수 있습니다.
🛡️ 대응 방법
배포판 제공 최신 커널 패키지로 업데이트하고 재부팅합니다.
🔧 검증 코드
출력된 커널 버전이 배포판의 수정 패치가 포함된 최신 버전인지 확인하고, 모듈이 로드되지 않았다면 이 취약점의 영향을 받지 않습니다.
uname -r && (lsmod | grep -i acpi_power_meter || echo 'acpi_power_meter 모듈 미로드')