🇰🇷 한글 설명
Linux 커널의 cdx 드라이버 내 driver_override_show() 함수에서 Use-After-Free(UAF) 취약점이 발견되었습니다. sysfs를 통해 driver_override_store()와 driver_override_show()가 동시에 실행될 때 적절한 잠금(locking)이 이루어지지 않아 발생하며, 이로 인해 커널 주소가 노출될 수 있습니다.
💡 쉬운 설명
컴퓨터의 핵심 운영체제인 리눅스에서 데이터를 읽고 쓰는 과정이 동시에 일어날 때, 이미 삭제된 메모리 주소를 참조하는 오류가 발생할 수 있습니다. 이 오류를 이용하면 해커가 시스템의 중요한 내부 정보를 훔쳐볼 수 있는 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
cdx: Fix possible UAF error in driver_override_show()
Fixed a possible UAF problem in driver_override_show() in drivers/cdx/cdx.c
This function driver_override_show() is part of DEVICE_ATTR_RW, which
includes both driver_override_show() and driver_override_store().
These functions can be executed concurrently in sysfs.
The driver_override_store() function uses driver_set_override() to
update the driver_override value, and driver_set_override() internally
locks the device (device_lock(dev)). If driver_override_show() reads
cdx_dev->driver_override without locking, it could potentially access
a freed pointer if driver_override_store() frees the string
concurrently. This could lead to printing a kernel address, which is a
security risk since DEVICE_ATTR can be read by all users.
Additionally, a similar pattern is used in drivers/amba/bus.c, as well
as many other bus drivers, where device_lock() is taken in the show
function, and it has been working without issues.
This potential bug was detected by our experimental static analysis
tool, which analyzes locking APIs and paired functions to identify
data races and atomicity violations.
📍 영향받는 시스템
Linux kernel (cdx driver 및 유사한 패턴을 사용하는 amba bus 드라이버 포함)
⚔️ 공격 벡터
sysfs 인터페이스를 통한 동시적인 driver_override 읽기 및 쓰기 작업 수행
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 driver_override_show() 함수에 적절한 device_lock()을 적용해야 합니다.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인합니다.