🇰🇷 한글 설명
Linux 커널의 fbdev 구성 요소에서 fb_new_modelist 함수가 새로운 모드 목록을 검증할 때 현재 사용 중인 모드가 포함되어 있는지 확인하지 않아 발생하는 취약점입니다. 이로 인해 fb_videomode_to_var 함수에서 NULL 포인터 역참조가 발생하여 시스템 충돌이나 커널 패닉을 유발할 수 있습니다.
💡 쉬운 설명
컴퓨터 화면을 조절하는 설정 목록을 바꿀 때, 현재 사용 중인 화면 설정이 목록에서 사라지면서 시스템이 길을 잃고 멈춰버리는 문제입니다. 잘못된 정보를 참조하려다 보니 컴퓨터가 오류를 일으키며 꺼질 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
fbdev: Fix fb_new_modelist to prevent null-ptr-deref in fb_videomode_to_var
info->var, a framebuffer's current mode, is expected to have a matching
entry in info->modelist. var_to_display() relies on this and treats a
failed fb_match_mode() as "This should not happen". fb_set_var() keeps it
true by adding the mode to the list on every change, and
do_register_framebuffer() does the same at registration.
store_modes() replaces the modelist from userspace. fb_new_modelist()
validates the new modes but does not check that info->var still has a
match. It relies on fbcon_new_modelist() to re-point consoles, but that
only handles consoles mapped to the framebuffer. With fbcon unbound there
are none, so info->var is left describing a mode that is no longer in the
list.
A later console takeover runs var_to_display(), where fb_match_mode()
returns NULL and leaves fb_display[i].mode NULL. fbcon_switch() passes it
to display_to_var(), and fb_videomode_to_var() dereferences the NULL mode.
Keep the current mode in the list in fb_new_modelist(), the same way
fb_set_var() does.
📍 영향받는 시스템
Linux kernel (fbdev subsystem)
⚔️ 공격 벡터
사용자 공간(userspace)에서 store_modes()를 통해 조작된 모드 목록을 전달하여 발생
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 fb_new_modelist()의 검증 로직을 수정해야 함
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인