🇰🇷 한글 설명
Linux 커널 SCTP 서브시스템에서, 현재 메시지의 모든 fragment 청크가 prune(제거)되었을 때 stream->out_curr 포인터가 NULL로 초기화되지 않아 발생하는 문제입니다. 이로 인해 빈 outq에서 청크를 dequeue하려 하면서 list_del 손상 및 커널 경고가 발생할 수 있습니다. 패치는 sctp_prsctp_prune_unsent()에서 마지막 fragment 청크가 제거될 때 out_curr를 NULL로 설정하도록 수정합니다.
💡 쉬운 설명
네트워크 통신 프로토콜(SCTP)을 처리하는 리눅스 커널 코드에서 데이터 조각을 정리하던 중 내부 포인터가 잘못 남아 있던 결함입니다. 이 결함으로 인해 시스템이 비정상 종료되거나 경고가 출력될 수 있어 커널 패치로 수정되었습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
sctp: clear out_curr if all frag chunks of current msg are pruned
A crash was reported by Zhen Chen:
list_del corruption, ffffa035ddf01c18->next is NULL
WARNING: CPU: 1 PID: 250682 at lib/list_debug.c:49 __list_del_entry_valid+0x59/0xe0
RIP: 0010:__list_del_entry_valid+0x59/0xe0
Call Trace:
sctp_sched_dequeue_common+0x17/0x70 [sctp]
sctp_sched_fcfs_dequeue+0x37/0x50 [sctp]
sctp_outq_flush_data+0x85/0x360 [sctp]
sctp_outq_uncork+0x77/0xa0 [sctp]
sctp_cmd_interpreter.constprop.0+0x164/0x1450 [sctp]
sctp_side_effects+0x37/0xe0 [sctp]
sctp_do_sm+0xd0/0x230 [sctp]
sctp_primitive_SEND+0x2f/0x40 [sctp]
sctp_sendmsg_to_asoc+0x3fa/0x5c0 [sctp]
sctp_sendmsg+0x3d5/0x440 [sctp]
sock_sendmsg+0x5b/0x70
and in sctp_sched_fcfs_dequeue() it dequeued a chunk from stream
out_curr outq while this outq was empty.
Normally stream->out_curr must be set to NULL once all frag chunks of
current msg are dequeued, as we can see in sctp_sched_dequeue_done().
However, in sctp_prsctp_prune_unsent() as it is not a proper dequeue,
sctp_sched_dequeue_done() is not called to do this.
This patch is to fix it by simply setting out_curr to NULL when the
last frag chunk of current msg is dequeued from out_curr stream in
sctp_prsctp_prune_unsent().
📍 영향받는 시스템
SCTP 모듈을 포함한 패치 이전의 Linux 커널 버전 (정확한 영향 범위는 해당 배포판 보안 공지 확인 필요)
⚔️ 공격 벡터
SCTP 소켓을 통해 메시지를 전송하며 PR-SCTP 부분 신뢰성 정리(prune) 동작을 유발하는 방식으로 악용될 수 있으며, 주로 시스템 불안정(크래시)을 초래할 수 있습니다.
🛡️ 대응 방법
배포판 제공 최신 커널로 업데이트하거나, 해당 SCTP 모듈이 불필요하면 blacklist 설정으로 비활성화합니다.
🔧 검증 코드
출력된 커널 버전을 배포판 보안 공지의 패치 버전과 비교하고, lsmod 결과가 비어 있으면 SCTP 모듈이 로드되지 않아 영향이 낮으며, 패키지 정보로 패키지 설치 상태를 확인합니다.
uname -r; lsmod | grep -w sctp; dpkg -l linux-image-$(uname -r) 2>/dev/null | tail -1