🇰🇷 한글 설명
Linux 커널의 CAN(Controller Area Network) 드라이버에서 발생한 레이스 컨디션 취약점입니다. bcm_sendmsg() 함수가 락을 획득하기 전에 ifindex와 bound 상태를 확인하는 과정에서 데이터 불일치가 발생하여, 특정 인터페이스에 바인딩된 소켓이 의도치 않게 모든 인터페이스에 매칭될 수 있습니다.
💡 쉬운 설명
데이터를 처리하는 과정에서 순서가 꼬여 보안 설정이 무력화될 수 있는 결함입니다. 이로 인해 특정 장치에만 연결되어야 할 통신이 엉뚱한 장치로 전달될 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
can: bcm: fix lockless bound/ifindex race and silent RX_SETUP failure
bcm_sendmsg() reads bo->ifindex and checks bo->bound before taking
lock_sock(), while bcm_notify(), bcm_connect() and bcm_release() all
mutate both fields under that same lock. Because the lockless reads
and the locked writes are unordered with respect to each other, a
racing bcm_notify() (device unregister) or bcm_connect() (concurrent
bind on another thread sharing the socket) can make bcm_sendmsg()
observe an inconsistent combination, e.g. a stale bound=1 together
with the now-cleared ifindex=0, silently turning a socket bound to a
specific CAN interface into one that also matches "any" interface.
Keep the lockless bo->bound check purely as a fast-path reject, and
move the ifindex read (and a bo->bound re-check) into the locked
section, where every writer already serializes. This removes the
possibility of observing the two fields torn against each other,
rather than trying to fix it with more READ_ONCE()/WRITE_ONCE() pairs
on two independently updated fields. Annotate the now-purely-lockless
bo->bound accesses consistently across all its write sites.
Also fix bcm_rx_setup() silently returning success when the target
device disappears concurrently instead of reporting -ENODEV, so a
broken RX op is no longer left registered as if it had succeeded.
📍 영향받는 시스템
Linux kernel (CAN subsystem, bcm driver 포함 버전)
⚔️ 공격 벡터
동시 다발적인 소켓 바인딩 및 장치 해제 작업을 통한 레이스 컨디션 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하십시오.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인하십시오.