🇰🇷 한글 설명
Linux 커널의 TLS 구현에서 sk_msg 링 버퍼가 가득 찼을 때 이를 처리하지 못해 발생하는 취약점입니다. 이로 인해 데이터가 덮어씌워지거나 메모리 경계를 벗어나는 scatterwalk 오류가 발생하여 커널 NULL 포인터 역참조 및 시스템 충돌을 유발할 수 있습니다.
💡 쉬운 설명
데이터를 전달하는 통로가 꽉 찼을 때 이를 비워주지 않아 발생하는 오류입니다. 공격자가 이 통로를 조작하면 컴퓨터의 핵심 시스템(커널)이 갑자기 멈추거나 오류를 일으킬 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
tls: don't leave a full plaintext sk_msg ring unpushed
When the copy path in tls_sw_sendmsg_locked() adds the fragment that fills
the plaintext sk_msg ring, it does not set full_record, so the record is
left full and unpushed. A later splice() then adds to an already full
ring: sk_msg_page_add() has no fullness check of its own, so sg.end wraps
onto sg.start and the ring appears empty. Fragments added after that
overwrite live entries, and sg.size no longer matches what is reachable
between sg.start and sg.end, so pushing the record runs the scatterwalk off
the end of the scatterlist.
An unprivileged user can trigger this on a loopback TCP socket with the
"tls" ULP attached:
BUG: kernel NULL pointer dereference, address: 0000000000000008
RIP: 0010:memcpy_from_scatterwalk+0x32/0xc0
Call Trace:
skcipher_walk_next+0x1d1/0x2c0
gcm_encrypt_aesni_avx+0x1e9/0x220
bpf_exec_tx_verdict+0x3bb/0x860
tls_sw_sendmsg+0xa1a/0xca0
__sys_sendto+0x1da/0x1f0
Set full_record in the copy path when the ring becomes full, and push a
record that is already full on entry to the sendmsg loop.
📍 영향받는 시스템
TLS ULP가 활성화된 loopback TCP 소켓을 사용하는 Linux 커널 버전
⚔️ 공격 벡터
권한이 없는 사용자가 TLS가 적용된 loopback TCP 소켓을 통해 특정 데이터 전송 패턴을 반복적으로 수행
🛡️ 대응 방법
커널의 tls_sw_sendmsg_locked() 함수 내에서 링이 가득 찼을 때 full_record를 설정하도록 커널 패치 적용
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 최신 보안 패치 버전인지 확인