🇰🇷 한글 설명
리눅스 커널의 dma-buf 구현 중 dma_buf_fd() 트레이스포인트에서 Use-After-Free(UAF) 취약점이 발견되었습니다. FD_ADD() 호출 이후 트레이스포인트가 실행되기 전 다른 스레드가 파일 디스크립터를 닫을 경우, 이미 해제된 메모리 영역에 접근하여 시스템 오류나 권한 상승을 유발할 수 있습니다.
💡 쉬운 설명
파일을 사용하는 과정에서 데이터가 이미 삭제되었는데 이를 다시 사용하려고 시도할 때 발생하는 보안 결함입니다. 이로 인해 시스템이 멈추거나 해커가 시스템 제어권을 얻을 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
dma-buf: fix UAF in dma_buf_fd() tracepoint
Once FD_ADD() returns, the fd is live in the file descriptor table
and a thread sharing that table can close() it before DMA_BUF_TRACE()
runs. The close drops the last reference, __fput() frees the dma_buf,
and the tracepoint then dereferences dmabuf to take dmabuf->name_lock
-- slab-use-after-free.
Split FD_ADD() back into get_unused_fd_flags() + fd_install() and
emit the tracepoint between them. While the fdtable slot is reserved
with a NULL file pointer, a racing close() returns -EBADF without
entering __fput(), so the dma_buf stays alive across the trace. Same
approach as commit 2d76319c4cbb ("dma-buf: fix UAF in dma_buf_put()
tracepoint").
This undoes the FD_ADD() conversion done in commit 34dfce523c90
("dma: convert dma_buf_fd() to FD_ADD()"); FD_ADD() has no place to
hook the tracepoint safely.
📍 영향받는 시스템
dma-buf 관련 트레이스포인트를 사용하는 리눅스 커널 버전 (FD_ADD() 전환 이후 버전)
⚔️ 공격 벡터
멀티스레드 환경에서 파일 디스크립터를 생성함과 동시에 의도적으로 닫는 레이스 컨디션(Race Condition) 공격
🛡️ 대응 방법
커널 패치를 적용하여 FD_ADD()를 get_unused_fd_flags()와 fd_install()로 분리하고 트레이스포인트 위치를 안전하게 조정해야 합니다.
🔧 검증 코드
출력된 커널 버전을 확인하여 해당 취약점이 수정된 최신 보안 패치 버전인지 확인합니다.