🇰🇷 한글 설명
Linux 커널의 Bluetooth L2CAP 스택에서 l2cap_ecred_conn_req 함수 내 스택 범위 외 읽기(stack-out-of-bounds read) 취약점이 발견되었습니다. 공격자가 조작된 Enhanced Credit Based Connection Request를 보내면, 유효성 검사 전에 계산된 잘못된 길이 값으로 인해 스택 버퍼의 범위를 벗어난 메모리 읽기가 발생하여 시스템 패닉을 유발할 수 있습니다.
💡 쉬운 설명
블루투스 연결 요청을 보낼 때 데이터 길이를 속여서 컴퓨터의 허용된 메모리 범위를 넘어서 읽게 만드는 오류입니다. 이로 인해 블루투스 기능이 오작동하거나 시스템이 갑자기 멈출 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
Bluetooth: L2CAP: Fix stack-out-of-bounds read in l2cap_ecred_conn_req
Syzbot reported a KASAN stack-out-of-bounds read in l2cap_build_cmd()
that is triggered by a malformed Enhanced Credit Based Connection Request.
The vulnerability stems from l2cap_ecred_conn_req(). The function allocates
a local stack buffer (`pdu`) designed to hold a maximum of 5 Source Channel
IDs (SCIDs), totaling 18 bytes. When an attacker sends a request with more
than 5 SCIDs, the function calculates `rsp_len` based on this unvalidated
`cmd_len` before checking if the number of SCIDs exceeds
L2CAP_ECRED_MAX_CID.
If the SCID count is too high, the function correctly jumps to the
`response` label to reject the packet, but `rsp_len` retains the
attacker's oversized value. Consequently, l2cap_send_cmd() is instructed
to read past the end of the 18-byte `pdu` buffer, triggering a
KASAN panic.
Fix this by moving the assignment of `rsp_len` to after the `num_scid`
boundary check. If the packet is rejected, `rsp_len` will safely
remain 0, and the error response will only read the 8-byte base header
from the stack.
📍 영향받는 시스템
Linux Kernel (Bluetooth L2CAP stack)
⚔️ 공격 벡터
조작된 L2CAP Enhanced Credit Based Connection Request 패킷 전송
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 l2cap_ecred_conn_req 함수의 rsp_len 할당 로직을 수정해야 합니다.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인합니다.