🇰🇷 한글 설명
Linux 커널의 fbcon 모듈에서 fbcon_do_set_font() 함수가 실패할 때 hi_font 상태를 제대로 복구하지 못하는 취약점입니다. 이로 인해 터미널 상태가 불일치하게 되어, 사용자 공간에서 비정상적인 인덱스를 통해 커널 메모리를 읽을 수 있는 Out-of-bounds read가 발생합니다.
💡 쉬운 설명
글꼴을 바꾸는 과정에서 오류가 발생했을 때, 시스템이 이전 상태로 완벽하게 되돌아가지 못해 발생하는 문제입니다. 이 틈을 타서 공격자가 컴퓨터의 중요한 내부 정보를 몰래 훔쳐볼 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
fbdev: fbcon: fix out-of-bounds read in err_out of fbcon_do_set_font()
When fbcon_do_set_font() fails (e.g., due to a memory allocation failure
inside vc_resize() under heavy memory pressure), it jumps to the `err_out`
label to roll back the console state. However, the current rollback logic
forgets to restore the `hi_font` state, leading to a severe state machine
corruption.
Earlier in the function, `set_vc_hi_font()` might be called to change
`vc->vc_hi_font_mask` and mutate the screen buffer. If `vc_resize()`
subsequently fails, the `err_out` path restores `vc_font.charcount`
but entirely skips rolling back the `vc_hi_font_mask` and the screen
buffer.
This mismatch leaves the terminal in a desynchronized state. Because
`vc_hi_font_mask` remains set, the VT subsystem will still accept
character indices greater than 255 from userspace and write them to the
screen buffer. Subsequent rendering calls (e.g., `fbcon_putcs()`) will
then use these inflated indices to access the reverted, 256-character
font array, leading to a deterministic out-of-bounds read and potential
kernel memory disclosure.
Fix this by adding the missing rollback logic for the `hi_font` mask
and screen buffer in the error path.
📍 영향받는 시스템
Linux Kernel (fbcon/fbdev 관련 모듈 사용 시스템)
⚔️ 공격 벡터
메모리 압박 상황을 유도하여 글꼴 설정 오류를 발생시킨 후, 비정상적인 캐릭터 인덱스를 입력하여 커널 메모리 읽기 시도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 fbcon_do_set_font()의 오류 처리 로직을 수정해야 합니다.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인합니다.