🇰🇷 한글 설명
Linux 커널의 ksmbd 모듈 내 smb_check_perm_dacl() 함수에서 ACE-walk 루프 중 경계 검사 오류로 인한 OOB(Out-of-Bounds) Read 취약점이 발견되었습니다. 이전 패치에서 경계 검사 로직이 잘못 작성되어 유효하지 않은 크기의 ACE를 처리할 때 힙 영역의 범위를 벗어난 읽기 작업이 발생할 수 있습니다.
💡 쉬운 설명
리눅스 서버의 파일 공유 기능(ksmbd)에서 데이터의 크기를 확인하는 검사 과정에 오류가 있어, 허용되지 않은 메모리 영역을 읽을 수 있는 보안 결함입니다. 이를 통해 공격자가 시스템의 민감한 정보를 훔쳐볼 위험이 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
ksmbd: OOB read regression in smb_check_perm_dacl() ACE-walk loops
Commit d07b26f39246 ("ksmbd: require minimum ACE size in
smb_check_perm_dacl()") introduced a transposed bounds check:
if (offsetof(struct smb_ace, sid) + aces_size < CIFS_SID_BASE_SIZE)
Since offsetof(..sid) is 8 and CIFS_SID_BASE_SIZE is 8, this evaluates
to `aces_size < 0`. Because `aces_size` is always non-negative, this
check becomes dead code and never breaks the loop.
Worse, that commit removed the old 4-byte guard, meaning the loop now
reads `ace->size` (offset 2) even when `aces_size` is 0-3 bytes. This
re-opens a 2-byte heap out-of-bounds (OOB) read past the pntsd allocation
during subsequent SMB2_CREATE operations.
Fix this by properly transposing the comparison to require at least
16 bytes (8-byte offset + 8-byte SID base), matching the correct form
used in smb_inherit_dacl().
📍 영향받는 시스템
ksmbd 모듈이 포함된 Linux 커널 버전 (d07b26f39246 커밋 이후 버전)
⚔️ 공격 벡터
조작된 SMB2_CREATE 요청을 통해 ksmbd 서버에 잘못된 크기의 ACE 데이터를 전송하여 발생
🛡️ 대응 방법
커널 패치를 통해 smb_check_perm_dacl()의 경계 검사 로직을 수정하거나 최신 커널로 업데이트
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 수정된 패치 버전인지 확인합니다.