🇰🇷 한글 설명
리눅스 커널의 n_gsm 드라이버에서 gsm0_receive() 함수 호출 시 경계 외 메모리 접근(Out-of-bounds)이 발생할 수 있는 취약점입니다. 모드 전환 과정에서 gsm->len 및 gsm->state 값이 적절히 초기화되지 않아 데이터 길이가 버퍼 크기를 초과하여 메모리 오염을 유발할 수 있습니다.
💡 쉬운 설명
GSM 통신 모드를 변경하는 과정에서 데이터 크기를 체크하는 로직에 허점이 있어, 정해진 메모리 공간보다 더 많은 데이터를 강제로 밀어넣을 수 있는 문제입니다. 이를 통해 시스템의 메모리가 망가져 보안 사고가 발생할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
tty: n_gsm: fix possible out-of-bounds in gsm0_receive()
Assuming the following:
- side A configures the n_gsm in basic option mode
- side B sends the header of a basic option mode frame with data length 1
- side A switches to advanced option mode
- side B sends 2 data bytes which exceeds gsm->len
Reason: gsm->len is not used in advanced option mode.
- side A switches to basic option mode
- side B keeps sending until gsm0_receive() writes past gsm->buf
Reason: Neither gsm->state nor gsm->len have been reset after
reconfiguration.
Fix this by changing gsm->count to gsm->len comparison from equal to less
than. Also add upper limit checks against the constant MAX_MRU in
gsm0_receive() and gsm1_receive() to harden against memory corruption of
gsm->len and gsm->mru.
All other checks remain as we still need to limit the data according to the
user configuration and actual payload size.
📍 영향받는 시스템
n_gsm 드라이버를 사용하는 리눅스 커널 버전
⚔️ 공격 벡터
특수하게 조작된 GSM 프레임을 전송하여 메모리 경계를 넘어서는 데이터를 입력하는 방식
🛡️ 대응 방법
리눅스 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 gsm0_receive() 및 gsm1_receive()의 경계 검사 로직을 수정해야 합니다.
🔧 검증 코드
출력된 커널 버전을 확인하여 해당 취약점이 해결된 패치 버전 이상인지 확인합니다.