🇰🇷 한글 설명
Linux 커널의 CAN(Controller Area Network) J1939 프로토콜 구현에서 j1939_session_deactivate 함수 호출 시 잘못된 WARN_ON_ONCE 조건이 발생합니다. 특정 동시성 시나리오에서 세션 참조 횟수(ref-count)가 2 미만일 때 경고가 발생하지만, 실제 세션 활성 상태를 체크하므로 시스템 기능상 문제는 없습니다.
💡 쉬운 설명
자동차나 산업 기기 통신에 쓰이는 리눅스 커널 소프트웨어에서, 특정 상황일 때 시스템이 잘못된 경고 메시지를 띄우는 오류가 발견되었습니다. 실제 데이터가 깨지거나 해킹되는 심각한 문제는 아니지만, 불필요한 경고가 발생하여 시스템 로그를 어지럽힐 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
can: j1939: fix errant WARN_ON_ONCE in j1939_session_deactivate
The conclusion "j1939_session_deactivate() should be called with a
session ref-count of at least 2" is incorrect. In some concurrent
scenarios, j1939_session_deactivate can be called with the session
ref-count less than 2. But there is not any problem because it
will check the session active state before session putting in
j1939_session_deactivate_locked().
Here is the concurrent scenario of the problem reported by syzbot
and my reproduction log.
cpu0 cpu1
j1939_xtp_rx_eoma
j1939_xtp_rx_abort_one
j1939_session_get_by_addr [kref == 2]
j1939_session_get_by_addr [kref == 3]
j1939_session_deactivate [kref == 2]
j1939_session_put [kref == 1]
j1939_session_completed
j1939_session_deactivate
WARN_ON_ONCE(kref < 2)
=====================================================
WARNING: CPU: 1 PID: 21 at net/can/j1939/transport.c:1088 j1939_session_deactivate+0x5f/0x70
CPU: 1 PID: 21 Comm: ksoftirqd/1 Not tainted 5.14.0-rc7+ #32
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1 04/01/2014
RIP: 0010:j1939_session_deactivate+0x5f/0x70
Call Trace:
j1939_session_deactivate_activate_next+0x11/0x28
j1939_xtp_rx_eoma+0x12a/0x180
j1939_tp_recv+0x4a2/0x510
j1939_can_recv+0x226/0x380
can_rcv_filter+0xf8/0x220
can_receive+0x102/0x220
? process_backlog+0xf0/0x2c0
can_rcv+0x53/0xf0
__netif_receive_skb_one_core+0x67/0x90
? process_backlog+0x97/0x2c0
__netif_receive_skb+0x22/0x80
📍 영향받는 시스템
Linux kernel (J1939 protocol enabled, specifically around version 5.14.0-rc7 and earlier)
⚔️ 공격 벡터
Local/Network-based (Triggered by specific concurrent J1939 session management operations)
🛡️ 대응 방법
Linux kernel을 최신 보안 패치가 적용된 버전으로 업데이트하십시오.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 버전(패치 적용 버전)인지 확인하십시오.