🇰🇷 한글 설명
Linux 커널의 gpib 드라이버 내 command_ioctl() 함수에서 descriptor_busy 참조 카운터가 중복 감소하는 취약점이 발견되었습니다. 이로 인해 카운터가 언더플로우되어 -1이 되면, 실제 사용 중인 디스크립터가 해제되어 Use-After-Free(UAF) 상태가 발생할 수 있습니다.
💡 쉬운 설명
프로그램이 사용 중인 데이터의 '사용 중' 표시를 실수로 두 번 지우면서, 아직 사용 중인데도 데이터를 삭제해 버리는 오류입니다. 이로 인해 시스템이 충돌하거나 해커가 시스템 권한을 탈취할 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
gpib: fix double decrement of descriptor_busy in command_ioctl()
commit d1857f8296dc ("gpib: fix use-after-free in IO ioctl handlers")
introduced a descriptor_busy reference counter to pin struct
gpib_descriptor across IO ioctl operations. In command_ioctl(), the
error path inside the loop decrements descriptor_busy and breaks, but
execution then falls through to the unconditional decrement after the
loop, underflowing the counter to -1.
This re-enables the use-after-free that the original fix was meant to
prevent: a concurrent close_dev_ioctl() sees descriptor_busy == 0 on
an actively-used descriptor and frees it.
Remove the early decrement from the error path. The post-loop
decrement already handles all exit paths, matching the correct pattern
used in read_ioctl() and write_ioctl().
📍 영향받는 시스템
Linux kernel (gpib driver 포함 버전)
⚔️ 공격 벡터
특수하게 조작된 IO ioctl 명령을 실행하여 참조 카운터를 조작함으로써 발생
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 취약점이 해결된 패치 버전 이후인지 확인