🇰🇷 한글 설명
Linux 커널의 tty 포트 드라이버에서 tty_port_tty_vhangup() 함수 호출 시 경쟁 상태(Race Condition)가 발생할 수 있는 취약점입니다. 이로 인해 포트가 완전히 종료되기 전에 함수가 반환될 수 있으며, 이는 Use-After-Free 및 NULL 포인터 역참조로 이어질 수 있습니다.
💡 쉬운 설명
장치를 연결 해제할 때 시스템 내부에서 여러 명령이 동시에 처리되면서 발생하는 충돌 문제입니다. 이 충돌로 인해 이미 사라진 메모리에 접근하려고 시도하여 시스템이 멈추거나 오류가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
tty: port: fix tty_port_tty_vhangup() race
Drivers rely on tty_port_tty_vhangup() to synchronously hang up their
ports before tearing down resources as part of deregistration (e.g. on
physical disconnect).
If tty_port_tty_vhangup() races with another hangup it may however
return before the port has been shut down. This is in turn can lead to
use-after-free and NULL-pointer dereferences in racing ioctls (including
a synchronous hangup) and in processing of racing asynchronous hangups
(carrier loss).
Add the missing serialisation to tty_port_tty_vhangup() and
tty_port_hangup() so that the former does not return until the port has
been shut down also when there is a racing hangup.
Note that serial core does not use tty_port_hangup(), but it already
holds the port mutex when clearing port->tty and shutting down the port
in uart_hangup().
📍 영향받는 시스템
Linux Kernel (tty port driver 관련 구성 요소)
⚔️ 공격 벡터
물리적 장치 연결 해제 또는 특정 ioctl 명령을 통한 동기/비동기 헝업(hangup) 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 tty_port_tty_vhangup() 및 tty_port_hangup()의 직렬화 로직을 적용해야 합니다.
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 수정된 패치 버전인지 확인합니다.