🇰🇷 한글 설명
Linux 커널의 fbcon(프레임버퍼 콘솔) 드라이버에서 store_modes sysfs 노드 접근 시 등록되지 않은 콘솔의 con2fb_map 인덱스가 -1이 되어 fbcon_registered_fb 배열 범위를 초과합니다. fbcon_info_from_console() 함수가 유효하지 않은 음수 인덱스로 배열에 접근하여 UBSAN 오류를 발생시킵니다.
💡 쉬운 설명
Linux 시스템의 화면 관련 기능에서 등록되지 않은 화면 정보에 접근할 때 프로그램이 잘못된 메모리 영역을 참조합니다. 이는 시스템 충돌이나 보안 문제를 야기할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
fbcon: Make sure modelist not set on unregistered console
It looks like attempting to write to the "store_modes" sysfs node will
run afoul of unregistered consoles:
UBSAN: array-index-out-of-bounds in drivers/video/fbdev/core/fbcon.c:122:28
index -1 is out of range for type 'fb_info *[32]'
...
fbcon_info_from_console+0x192/0x1a0 drivers/video/fbdev/core/fbcon.c:122
fbcon_new_modelist+0xbf/0x2d0 drivers/video/fbdev/core/fbcon.c:3048
fb_new_modelist+0x328/0x440 drivers/video/fbdev/core/fbmem.c:673
store_modes+0x1c9/0x3e0 drivers/video/fbdev/core/fbsysfs.c:113
dev_attr_store+0x55/0x80 drivers/base/core.c:2439
static struct fb_info *fbcon_registered_fb[FB_MAX];
...
static signed char con2fb_map[MAX_NR_CONSOLES];
...
static struct fb_info *fbcon_info_from_console(int console)
...
return fbcon_registered_fb[con2fb_map[console]];
If con2fb_map contains a -1 things go wrong here. Instead, return NULL,
as callers of fbcon_info_from_console() are trying to compare against
existing "info" pointers, so error handling should kick in correctly.
📍 영향받는 시스템
fbcon 드라이버가 활성화된 모든 Linux 배포판 (커널 버전별로 영향 범위 상이)
⚔️ 공격 벡터
시스템 권한이 있는 공격자가 /sys/class/graphics/fb*/store_modes 파일에 쓰기 작업 수행
🛡️ 대응 방법
Linux 커널을 CVE-2025-38198 패치가 포함된 최신 버전으로 업그레이드하여 NULL 체크 로직 적용
🔧 검증 코드
에러가 나타나지 않으면 취약점이 발생하지 않았거나 패치가 적용되었습니다. 에러가 있으면 커널 업데이트 필요
dmesg | grep -i 'array-index-out-of-bounds' | grep fbcon || echo 'No vulnerable fbcon errors'