🇰🇷 한글 설명
Linux 커널의 drm/amd/display 드라이버에서 로그 기록 시 초기화되지 않은 컨텍스트를 참조하여 발생하는 NULL 포인터 역참조 취약점입니다. 특정 함수 호출 과정에서 logger 객체가 생성되기 전에 로그를 시도할 경우 시스템 충돌이 발생할 수 있습니다.
💡 쉬운 설명
컴퓨터가 기록을 남기려고 할 때, 아직 준비되지 않은 메모리 주소를 참조하여 프로그램이 갑자기 멈추거나 꺼지는 문제입니다. 로그를 남기는 순서를 바로잡아 이 문제를 해결했습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
drm/amd/display: use proper context for logging
The same as the rest of the code, get_ss_info_from_atombios() uses
calc_pll_cs->ctx->logger for logging. But calc_pll_cs->ctx is
initialized only later in calc_pll_max_vco_construct(). Therefore, any
output using DC_LOG_SYNC() leads to a NULL pointer deference in
get_ss_info_from_atombios().
According to Sashiko, the very same problem exists in
dce112_get_pix_clk_dividers() and dcn3_get_pix_clk_dividers() too.
To avoid accessing the NULL context, use clk_src->base.ctx->logger
everywhere. That context in base is initialized earlier in
dce110_clk_src_construct() and dce112_clk_src_construct(). Before
get_ss_info_from_atombios() or Sashiko's get_pix_clk_dividers functions
above are actually called. This is done by redefining DC_LOGGER to
CTX->logger.
Before:
dce110_clk_src_construct() did:
-> sets clk_src->base.ctx = ctx;
-> ss_info_from_atombios_create()
-> get_ss_info_from_atombios() <- uses calc_pll_cs->ctx # BOOM
-> calc_pll_max_vco_construct() <- sets calc_pll_cs->ctx
After:
dce110_clk_src_construct() does:
-> sets clk_src->base.ctx = ctx;
-> ss_info_from_atombios_create()
-> get_ss_info_from_atombios() <- uses clk_src->base.ctx
(cherry picked from commit 6f16fcbb0c46a87e3d9685407e906573d60104b0)
📍 영향받는 시스템
Linux kernel (AMD DRM/display driver 관련 모듈 포함 버전)
⚔️ 공격 벡터
로컬 공격자가 특정 디스플레이 설정이나 드라이버 동작을 유도하여 커널 패닉(시스템 중단)을 일으킬 수 있음
🛡️ 대응 방법
커널 패치를 적용하여 로그 기록 시 초기화된 base 컨텍스트를 사용하도록 업데이트해야 함
🔧 검증 코드
현재 커널 버전과 해당 함수가 포함된 드라이버 소스/모듈의 존재 여부를 확인합니다.
uname -r && grep -r "get_ss_info_from_atombios" /lib/modules/$(uname -r)/kernel/drivers/gpu/drm/amd/