🇰🇷 한글 설명
Linux 커널의 usb gadget f_fs 구성 요소에서 AIO 오류 경로 처리 중 Use-After-Free 취약점이 발견되었습니다. ffs_epfile_io()가 특정 오류를 반환할 때 io_data 구조체가 해제되지만, 동시에 실행되는 취소 작업이 이미 해제된 포인터에 접근하여 발생합니다. 이를 해결하기 위해 취소 핸들러를 적절히 해제하고 -EIOCBQUEUED를 반환하도록 수정되었습니다.
💡 쉬운 설명
컴퓨터의 USB 연결을 관리하는 프로그램에서 데이터 처리 중 오류가 발생할 때, 이미 삭제된 메모리 주소를 다시 사용하려고 시도하는 문제가 있습니다. 이로 인해 시스템이 충돌하거나 보안 공격에 노출될 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
usb: gadget: f_fs: Fix Use-After-Free in AIO error path
In ffs_epfile_write_iter() and ffs_epfile_read_iter(), when ffs_epfile_io()
fails with an error other than -EIOCBQUEUED, the io_data structure (`p`) is
freed. However, for AIO operations, the kiocb cancel function was already
armed and kiocb->private was set to `p`.
If a concurrent cancel operation (such as sys_io_cancel()) executes after
ffs_epfile_io() fails but before the function frees `p`, a Use-After-Free
can occur when the cancellation handler accesses the freed pointer.
To securely fix this race condition, we must properly un-arm the
cancellation. Invoking `kiocb->ki_complete()` does exactly this by
acquiring `ctx->ctx_lock` and safely removing the kiocb from the active
sequence. In doing so, it ensures that a parallel io_cancel can no longer
discover the kiocb, effectively closing the race window.
We then return -EIOCBQUEUED to notify the VFS layer that the kiocb has been
consumed and it should avoid attempting to complete the request again or
triggering subsequent completion handlers.
📍 영향받는 시스템
Linux Kernel (usb gadget f_fs 구성 요소 사용 시스템)
⚔️ 공격 벡터
비동기 I/O(AIO) 작업 중 특정 오류를 유도하고 동시에 작업 취소를 요청하는 레이스 컨디션 공격
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하십시오.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인하십시오.