🇰🇷 한글 설명
Linux 커널의 bq27xxx 배터리 드라이버에서 poll_interval 처리 오류 및 제거 시 레이스 컨디션(Race Condition) 취약점이 발견되었습니다. 드라이버 언바인드 시 설정값이 예기치 않게 변경되거나, 장치 제거 과정에서 작업 취소 전 리스트에서 제거되지 않아 발생하는 경합 상태를 해결해야 합니다.
💡 쉬운 설명
배터리 관리 프로그램이 장치를 제거하는 과정에서 순서가 꼬여 시스템 오류나 예기치 않은 동작이 발생할 수 있는 문제입니다. 장치가 사라지는 도중에 프로그램이 계속 작동하려고 시도하면서 충돌이 일어날 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
power: supply: bq27xxx: Fix poll_interval handling and races on remove
Before this patch bq27xxx_battery_teardown() was setting poll_interval = 0
to avoid bq27xxx_battery_update() requeuing the delayed_work item.
There are 2 problems with this:
1. If the driver is unbound through sysfs, rather then the module being
rmmod-ed, this changes poll_interval unexpectedly
2. This is racy, after it being set poll_interval could be changed
before bq27xxx_battery_update() checks it through
/sys/module/bq27xxx_battery/parameters/poll_interval
Fix this by added a removed attribute to struct bq27xxx_device_info and
using that instead of setting poll_interval to 0.
There also is another poll_interval related race on remove(), writing
/sys/module/bq27xxx_battery/parameters/poll_interval will requeue
the delayed_work item for all devices on the bq27xxx_battery_devices
list and the device being removed was only removed from that list
after cancelling the delayed_work item.
Fix this by moving the removal from the bq27xxx_battery_devices list
to before cancelling the delayed_work item.
📍 영향받는 시스템
Linux kernel (bq27xxx battery driver 사용 시스템)
⚔️ 공격 벡터
로컬 공격자가 sysfs를 통해 드라이버를 언바인드하거나 poll_interval 파라미터를 조작하여 레이스 컨디션 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인