🇰🇷 한글 설명
Linux 커널의 aio poll 과정에서 POLLFREE 처리가 누락되어 발생하는 Use-After-Free 취약점입니다. signalfd 또는 binder fd가 aio poll로 호출될 때 대기 큐가 해제되면서 메모리 오류가 발생할 수 있습니다.
💡 쉬운 설명
컴퓨터가 이미 사용이 끝나서 삭제된 메모리 영역을 다시 사용하려고 할 때 발생하는 오류입니다. 이로 인해 시스템이 멈추거나 해커가 권한을 탈취할 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
aio: fix use-after-free due to missing POLLFREE handling
signalfd_poll() and binder_poll() are special in that they use a
waitqueue whose lifetime is the current task, rather than the struct
file as is normally the case. This is okay for blocking polls, since a
blocking poll occurs within one task; however, non-blocking polls
require another solution. This solution is for the queue to be cleared
before it is freed, by sending a POLLFREE notification to all waiters.
Unfortunately, only eventpoll handles POLLFREE. A second type of
non-blocking poll, aio poll, was added in kernel v4.18, and it doesn't
handle POLLFREE. This allows a use-after-free to occur if a signalfd or
binder fd is polled with aio poll, and the waitqueue gets freed.
Fix this by making aio poll handle POLLFREE.
A patch by Ramji Jiyani <
[email protected]>
(https://lore.kernel.org/r/
[email protected])
tried to do this by making aio_poll_wake() always complete the request
inline if POLLFREE is seen. However, that solution had two bugs.
First, it introduced a deadlock, as it unconditionally locked the aio
context while holding the waitqueue lock, which inverts the normal
locking order. Second, it didn't consider that POLLFREE notifications
are missed while the request has been temporarily de-queued.
The second problem was solved by my previous patch. This patch then
properly fixes the use-after-free by handling POLLFREE in a
deadlock-free way. It does this by taking advantage of the fact that
freeing of the waitqueue is RCU-delayed, similar to what eventpoll does.
📍 영향받는 시스템
Linux kernel (aio poll 기능이 포함된 버전)
⚔️ 공격 벡터
특수하게 조작된 aio poll 요청을 통해 메모리 해제 후 재사용 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전을 확인하여 해당 취약점이 해결된 패치 버전인지 확인합니다.