🇰🇷 한글 설명
Linux 커널의 fbdev 구성 요소에서 store_modes() 함수 호출 시 발생하는 Use-After-Free 취약점입니다. 새로운 모드 리스트로 교체하는 과정에서 기존 리스트를 참조하던 포인터들을 적절히 초기화하지 않아, 해제된 메모리에 접근할 수 있는 문제가 발생합니다.
💡 쉬운 설명
컴퓨터 화면 설정을 변경할 때, 이미 삭제된 옛날 설정 정보를 시스템이 계속 참조하려고 시도하면서 발생하는 오류입니다. 이로 인해 시스템이 갑자기 멈추거나 보안 문제가 생길 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
fbdev: fix use-after-free in store_modes()
store_modes() replaces a framebuffer's modelist with modes from userspace.
On success it frees the old modelist with fb_destroy_modelist(). Two
fields still point into that freed list.
One pointer is fb_display[i].mode, the mode a console is using.
fbcon_new_modelist() moves these pointers to the new list. It only does so
for consoles still mapped to the framebuffer. An unmapped console is
skipped and keeps its stale pointer. Unbinding fbcon, for example, sets
con2fb_map[i] to -1 but leaves fb_display[i].mode set. An
FBIOPUT_VSCREENINFO ioctl with FB_ACTIVATE_INV_MODE later reaches
fbcon_mode_deleted(). That function reads the stale fb_display[i].mode
through fb_mode_is_equal(). The read is a use-after-free.
The other pointer is fb_info->mode, the current mode. It is set through
the mode sysfs attribute. store_modes() does not update fb_info->mode, so
it is left pointing into the freed list. show_mode(), the attribute's read
handler, dereferences the stale fb_info->mode through mode_string(). The
read is a use-after-free.
Clear both pointers before freeing the list. Commit a1f305893074 ("fbcon:
Set fb_display[i]->mode to NULL when the mode is released") added the
helper fbcon_delete_modelist(). It clears every fb_display[i].mode that
points into a given list. So far it is called only from the unregister
path. Call it from store_modes() too, and set fb_info->mode to NULL.
📍 영향받는 시스템
Linux kernel (fbdev subsystem)
⚔️ 공격 벡터
사용자 공간(userspace)에서 FBIOPUT_VSCREENINFO ioctl 호출 또는 sysfs mode 속성 조작을 통한 메모리 참조 유도
🛡️ 대응 방법
커널 패치(a1f305893074 및 관련 수정사항)를 적용하여 fb_display[i].mode와 fb_info->mode를 NULL로 초기화해야 함
🔧 검증 코드
현재 실행 중인 커널 버전을 확인하여 해당 취약점이 해결된 패치 버전인지 확인합니다.