🇰🇷 한글 설명
Linux 커널의 atomisp 미디어 드라이버에서 gmin_get_var_int() 함수 호출 시 스택 버퍼 오버플로우가 발생할 수 있는 취약점입니다. EFI 변수가 예상된 버퍼 크기보다 클 경우, 오류 처리 미흡으로 인해 잘못된 길이 값이 사용되어 스택 메모리를 초과하여 데이터를 기록하게 됩니다.
💡 쉬운 설명
카메라 장치를 설정하는 과정에서 시스템 설정값이 정해진 저장 공간보다 클 경우, 데이터가 넘쳐흘러 시스템을 망가뜨리거나 해커가 명령을 실행할 수 있는 문제입니다. 이는 Intel Bay Trail 및 Cherry Trail 플랫폼의 카메라 드라이버에서 발생합니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
staging: media: atomisp: Fix stack buffer overflow in gmin_get_var_int()
When gmin_get_config_var() calls efi.get_variable() and the EFI variable
is larger than the expected buffer size, two behaviors combine to create
a stack buffer overflow:
1. gmin_get_config_var() does not return the proper error code when
efi.get_variable() fails. It returns the stale 'ret' value from
earlier operations instead of indicating the EFI failure.
2. When efi.get_variable() returns EFI_BUFFER_TOO_SMALL, it updates
*out_len to the required buffer size but writes no data to the output
buffer. However, due to bug #1, gmin_get_var_int() believes the call
succeeded.
The caller gmin_get_var_int() then performs:
- Allocates val[CFG_VAR_NAME_MAX + 1] (65 bytes) on stack
- Calls gmin_get_config_var(dev, is_gmin, var, val, &len) with len=64
- If EFI variable is >64 bytes, efi.get_variable() sets len=required_size
- Due to bug #1, thinks call succeeded with len=required_size
- Executes val[len] = 0, writing past end of 65-byte stack buffer
This creates a stack buffer overflow when EFI variables are larger than
64 bytes. Since EFI variables can be controlled by firmware or system
configuration, this could potentially be exploited for code execution.
Fix the bug by returning proper error codes from gmin_get_config_var()
based on EFI status instead of stale 'ret' value.
The gmin_get_var_int() function is called during device initialization
for camera sensor configuration on Intel Bay Trail and Cherry Trail
platforms using the atomisp camera stack.
📍 영향받는 시스템
Linux kernel (staging: media: atomisp driver)
⚔️ 공격 벡터
펌웨어나 시스템 설정을 통해 조작된 크기의 EFI 변수를 제공하여 스택 버퍼 오버플로우 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인