🇰🇷 한글 설명
Linux 커널의 IIO(Industrial I/O) 서브시스템에서 익명 버퍼 해제 시 Use-After-Free 취약점이 발견되었습니다. 버퍼 해제 함수가 뮤텍스 잠금을 해제하기 전에 IIO 장치를 먼저 해제함으로써, 이미 해제된 메모리 영역의 뮤텍스에 접근하여 시스템 오류를 유발할 수 있습니다.
💡 쉬운 설명
장치를 제거할 때 메모리를 정리하는 과정에서 순서가 잘못되어, 이미 사라진 메모리 공간을 다시 사용하려고 시도하는 문제입니다. 이로 인해 시스템이 충돌하거나 보안 문제가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
iio: buffer: Fix potential use-after-free in anonymous buffer release
An anonymous buffer handle holds a reference to the underlying IIO device.
The reference is dropped in the buffer handle's release function. If the
device has been removed, either through unbind or hot-unplug, the buffer
handle might hold the last reference.
The release function takes the mutex for the buffer using a guard, which
means the unlock happens after all the code in the function, including
`iio_device_put()`. If the anonymous buffer holds the last reference this
might free both the IIO device and the buffer, which contains the mutex,
leading to use-after-free when the mutex is unlocked.
Fix this by using a scoped guard just around the buffer dmabuf list access,
making sure the mutex is unlocked before releasing the IIO device.
Version 10 of the patch that introduced this issue used this exact scheme
of first unlocking and then dropping the reference [1]. During review it
was suggested to use a guard instead, and version 11 made that change [2].
📍 영향받는 시스템
Linux Kernel (IIO 서브시스템을 사용하는 버전)
⚔️ 공격 벡터
장치의 핫플러그(Hot-unplug) 또는 언바인드(Unbind)를 유도하여 메모리 해제 시점을 조작하는 방식
🛡️ 대응 방법
커널 패치를 적용하여 뮤텍스 잠금 해제와 IIO 장치 참조 해제 순서를 올바르게 수정해야 합니다.
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 취약점이 수정된 최신 패치 버전인지 확인합니다.