🇰🇷 한글 설명
Linux 커널의 PXA LCD Framebuffer 드라이버에서 드라이버 제거 시 메모리 해제 전에 스케줄된 작업이 해제된 메모리에 접근하는 Use-After-Free 취약점입니다. 이는 경쟁 조건으로 인해 발생하며, pxafb_remove 함수에서 작업 취소를 추가하여 수정되었습니다.
💡 쉬운 설명
리눅스 LCD 드라이버를 제거할 때 메모리가 이미 해제되었는데도 백그라운드 작업이 그 메모리에 접근하려고 시도하는 문제입니다. root 권한 사용자만 트리거할 수 있으며 시스템 불안정성을 유발할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
fbdev: pxafb: Fix possible use after free in pxafb_task()
In the pxafb_probe function, it calls the pxafb_init_fbinfo function,
after which &fbi->task is associated with pxafb_task. Moreover,
within this pxafb_init_fbinfo function, the pxafb_blank function
within the &pxafb_ops struct is capable of scheduling work.
If we remove the module which will call pxafb_remove to make cleanup,
it will call unregister_framebuffer function which can call
do_unregister_framebuffer to free fbi->fb through
put_fb_info(fb_info), while the work mentioned above will be used.
The sequence of operations that may lead to a UAF bug is as follows:
CPU0 CPU1
| pxafb_task
pxafb_remove |
unregister_framebuffer(info) |
do_unregister_framebuffer(fb_info) |
put_fb_info(fb_info) |
// free fbi->fb | set_ctrlr_state(fbi, state)
| __pxafb_lcd_power(fbi, 0)
| fbi->lcd_power(on, &fbi->fb.var)
| //use fbi->fb
Fix it by ensuring that the work is canceled before proceeding
with the cleanup in pxafb_remove.
Note that only root user can remove the driver at runtime.
📍 영향받는 시스템
PXA 기반 LCD 프레임버퍼 드라이버가 포함된 Linux 커널 시스템 (ARM 기반 PXA 칩셋 사용 디바이스)
⚔️ 공격 벡터
로컬 환경에서 root 권한으로 pxafb 드라이버 언로드 시 경쟁 조건을 이용한 해제된 메모리 접근
🛡️ 대응 방법
Linux 커널을 CVE-2024-49924 패치가 포함된 버전으로 업데이트하여 pxafb_remove에서 cancel_work_sync 추가
🔧 검증 코드
CONFIG_FB_PXA=y가 표시되면 pxafb 드라이버가 활성화된 것이며, 커널 버전 정보로 패치 적용 여부를 확인합니다.
grep -i 'CONFIG_FB_PXA' /boot/config-$(uname -r) && uname -r