🇰🇷 한글 설명
Linux 커널의 net: devmem 구성 요소에서 dma-buf 바인딩 시 페이지 정렬되지 않은 크기나 SG 길이를 검증하지 않아 발생하는 취약점입니다. 이로 인해 경계 검사를 우회하여 메모리 범위를 벗어난 읽기(Out-of-bounds read)가 발생하거나 데이터 동기화 오류가 발생할 수 있습니다.
💡 쉬운 설명
데이터를 주고받는 과정에서 데이터의 크기가 컴퓨터가 정해놓은 규칙(페이지 단위)에 맞지 않아도 그대로 허용하는 문제입니다. 이로 인해 허용되지 않은 메모리 영역을 읽거나 데이터가 꼬이는 보안 문제가 생길 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
net: devmem: reject dma-buf bind with non-page-aligned size or SG length
net_devmem_bind_dmabuf() trusts dmabuf->size and sg_dma_len() to be
PAGE_SIZE multiples without checking:
- tx_vec is sized dmabuf->size / PAGE_SIZE, and
net_devmem_get_niov_at() only bounds-checks virt_addr < dmabuf->size
before indexing tx_vec[virt_addr / PAGE_SIZE]. With size =
N*PAGE_SIZE + r (1 <= r < PAGE_SIZE), sendmsg() at iov_base =
N*PAGE_SIZE passes the bound check and reads tx_vec[N] -- one past.
- owner->area.num_niovs = len / PAGE_SIZE while gen_pool_add_owner()
covers the full byte len, so a non-page-multiple non-final sg
desyncs num_niovs from the gen_pool region for every later sg, on
both RX and TX.
dma-buf does not require page-aligned sizes, so the bind path has to
enforce what its own indexing assumes. Reject both with -EINVAL.
The size check is TX-only (only tx_vec is sized off dmabuf->size); the
SG-length check covers both directions.
📍 영향받는 시스템
Linux kernel (net: devmem 관련 모듈 사용 시스템)
⚔️ 공격 벡터
페이지 단위로 정렬되지 않은 크기의 dma-buf를 사용하여 메모리 경계 검사를 우회하고 잘못된 메모리 주소에 접근
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 dma-buf 바인딩 시 페이지 정렬 검증 로직을 적용
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인