🇰🇷 한글 설명
Linux 커널의 amdgpu 디스플레이 드라이버 내 dc_stream_set_cursor_attributes 함수에서 NULL 포인터 역참조 취약점이 발견되었습니다. 특정 상황에서 stream 포인터나 관련 구조체의 유효성을 검사하지 않고 접근하여 시스템 충돌을 유발할 수 있습니다.
💡 쉬운 설명
컴퓨터의 그래픽 화면을 처리하는 프로그램이 존재하지 않는 메모리 주소를 참조하려고 시도하여 시스템이 멈추거나 오류가 발생할 수 있는 문제입니다. 다행히 이 함수를 호출하는 상위 단계에서 이미 검사를 수행하고 있어 실제 위험도는 낮습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
drm/amd/display: Add NULL pointer checks in dc_stream cursor attribute functions
The function dc_stream_set_cursor_attributes() currently dereferences
the `stream` pointer and nested members `stream->ctx->dc->current_state`
without checking for NULL.
All callers of these functions, such as in
`dcn30_apply_idle_power_optimizations()` and
`amdgpu_dm_plane_handle_cursor_update()`, already perform NULL checks
before calling these functions.
Fixes below:
drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c:336 dc_stream_program_cursor_attributes()
error: we previously assumed 'stream' could be null (see line 334)
drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c
327 bool dc_stream_program_cursor_attributes(
328 struct dc_stream_state *stream,
329 const struct dc_cursor_attributes *attributes)
330 {
331 struct dc *dc;
332 bool reset_idle_optimizations = false;
333
334 dc = stream ? stream->ctx->dc : NULL;
^^^^^^
The old code assumed stream could be NULL.
335
--> 336 if (dc_stream_set_cursor_attributes(stream, attributes)) {
^^^^^^
The refactor added an unchecked dereference.
drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c
313 bool dc_stream_set_cursor_attributes(
314 struct dc_stream_state *stream,
315 const struct dc_cursor_attributes *attributes)
316 {
317 bool result = false;
318
319 if (dc_stream_check_cursor_attributes(stream, stream->ctx->dc->current_state, attributes)) {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Here.
This function used to check for if stream as NULL and return false at
the start. Probably we should add that back.
📍 영향받는 시스템
Linux Kernel (AMD GPU DRM 드라이버 사용 시스템)
⚔️ 공격 벡터
로컬 공격자가 커널 메모리 조작을 통해 특정 드라이버 함수를 호출하여 시스템을 중단시킬 수 있음
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하십시오.
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 수정된 패치 버전인지 확인합니다.