🇰🇷 한글 설명
Linux 커널의 CAN isotp 모듈에서 TX 상태 전이 과정 중 동기화 문제가 발견되었습니다. sendmsg(), RX 경로, hrtimer 타이머가 서로 다른 컨텍스트에서 상태를 변경할 때 락(lock)이 제대로 적용되지 않아 데이터 전송이 손상될 수 있는 취약점입니다. 이를 해결하기 위해 so->rx_lock을 사용하여 TX 상태 관리의 전체 생명주기를 보호하도록 수정되었습니다.
💡 쉬운 설명
데이터를 보내는 과정에서 여러 작업이 동시에 같은 정보를 수정하려고 할 때 충돌이 발생하는 문제입니다. 이로 인해 데이터가 엉뚱하게 전달되거나 시스템 오류가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
can: isotp: serialize TX state transitions under so->rx_lock
The TX state machine (so->tx.state) is driven from three contexts:
sendmsg() claiming and progressing a transfer, the RX path consuming
Flow Control/echo frames, and two hrtimers timing out a stalled
transfer. Mixing a lock-free cmpxchg() claim in sendmsg() with
hrtimer_cancel() calls made under so->rx_lock elsewhere left windows
where a frame or timer callback could act on a state that had already
moved on, corrupting an unrelated transfer.
so->rx_lock now covers the full lifecycle of a TX claim: sendmsg()
takes it to check so->tx.state is ISOTP_IDLE, switch it to
ISOTP_SENDING, bump so->tx_gen and drain the previous transfer's
timers - all as one critical section. isotp_rcv_fc()/isotp_rcv_cf()
already run under this lock via isotp_rcv(), and isotp_rcv_echo() now
takes it itself, so none of them can ever observe a transfer mid-claim.
This also means a transfer can no longer be handed to sendmsg()'s
cleanup paths (signal or send error) while another thread is
concurrently claiming or finishing it, so those paths can cancel
timers and reset the state unconditionally.
isotp_release() claims the socket the same way, so a racing sendmsg()
sees a consistent ISOTP_SHUTDOWN and skips arming its timer or sending.
Only the hrtimer callbacks stay outside so->rx_lock, since they run
under so->rx_lock's cancellation elsewhere and taking it themselves
would deadlock. so->tx_gen lets them recognize whether the transfer
they timed out is still the one currently active, so they don't
report an error against a transfer that has since completed or been
superseded.
📍 영향받는 시스템
Linux kernel (CAN isotp module 사용 환경)
⚔️ 공격 벡터
특정 타이밍에 데이터 전송과 타이머 콜백을 동시에 유도하여 상태 머신을 교란시키는 레이스 컨디션 공격
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하십시오.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인하십시오.