🇰🇷 한글 설명
Linux 커널의 ASoC sprd 드라이버에서 고정된 버퍼 크기를 검증하지 않아 발생하는 취약점입니다. 로컬 사용자가 조작된 파라미터를 통해 IRAM 및 DDR 버퍼 크기를 초과하는 데이터를 전송함으로써 메모리 오버플로우를 유발할 수 있습니다.
💡 쉬운 설명
컴퓨터 메모리에 정해진 크기보다 더 많은 데이터를 강제로 집어넣어 시스템을 망가뜨릴 수 있는 결함입니다. 공격자가 특수한 설정을 통해 메모리 경계를 넘어 데이터를 써버릴 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
ASoC: sprd: validate compress buffer sizes against fixed allocations
sprd_platform_compr_open() allocates the stage 0 IRAM buffer (32K data
area) and the stage 1 DDR buffer (2M data area) with fixed sizes, but
sprd_platform_compr_copy() derives all copy lengths from the user
controlled runtime->fragment_size and the write() count, never
comparing them against the physical buffer sizes. The compress core
only checks fragment_size * fragments for an u32 overflow in
snd_compress_check_input(), so a local user can configure a logical
buffer of up to ~4GB via SNDRV_COMPRESS_SET_PARAMS, far exceeding the
fixed allocations.
A fragment_size larger than the 32K IRAM data area makes the stage 0
copy_from_user() overflow past the IRAM allocation, and a buffer_size
larger than the 2M DDR buffer makes the wrapping copy at the end of
sprd_platform_compr_copy() write fully user controlled data past the
buffer. No SNDRV_PCM_TRIGGER_START is needed, a write() in SETUP
state reaches the copy callback directly.
Reject parameters that do not fit into the fixed buffers in
set_params(), and fix the advertised max fragment size: 128K never
fitted into the 32K IRAM buffer. The caps values may have been carried over
from the qdsp6 driver, which allocates its buffers according to the
advertised maxima, unlike this driver. With 32K as max fragment size
the advertised limits are self-consistent: 32K * 64 = 2M equals the
DDR buffer size.
Discovered by Atuin - Automated Vulnerability Discovery Engine.
📍 영향받는 시스템
Linux kernel (ASoC sprd driver component)
⚔️ 공격 벡터
로컬 사용자가 SNDRV_COMPRESS_SET_PARAMS를 통해 조작된 fragment_size를 설정하고 write() 함수를 호출하여 공격
🛡️ 대응 방법
커널 패치를 적용하여 set_params() 단계에서 고정 버퍼 크기에 맞지 않는 파라미터를 거부하도록 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 패치된 최신 보안 업데이트 버전인지 확인