🇰🇷 한글 설명
Linux 커널의 greybus 구성 요소에서 raw 번들이 연결 해제된 후에도 애플리케이션이 chardev를 열고 있을 때 발생하는 Use-After-Free 취약점입니다. 이로 인해 메모리 참조 오류가 발생하여 시스템 패닉(커널 크래시)이 유발될 수 있습니다.
💡 쉬운 설명
장치가 연결 해제되어 사라졌는데, 프로그램이 여전히 그 장치를 사용하려고 시도할 때 발생하는 오류입니다. 이 과정에서 컴퓨터의 핵심 시스템이 갑자기 멈추거나 꺼질 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
greybus: raw: fix use-after-free on cdev close
This addresses a use-after-free bug when a raw bundle is disconnected
but its chardev is still opened by an application. When the application
releases the cdev, it causes the following panic when init on free is
enabled (CONFIG_INIT_ON_FREE_DEFAULT_ON=y):
refcount_t: underflow; use-after-free.
WARNING: CPU: 0 PID: 139 at lib/refcount.c:28 refcount_warn_saturate+0xd0/0x130
...
Call Trace:
<TASK>
cdev_put+0x18/0x30
__fput+0x255/0x2a0
__x64_sys_close+0x3d/0x80
do_syscall_64+0xa4/0x290
entry_SYSCALL_64_after_hwframe+0x77/0x7f
The cdev is contained in the "gb_raw" structure, which is freed in the
disconnect operation. When the cdev is released at a later time,
cdev_put gets an address that points to freed memory.
To fix this use-after-free, convert the struct device from a pointer to
being embedded, that makes the lifetime of the cdev and of this device
the same. Then, use cdev_device_add, which guarantees that the device
won't be released until all references to the cdev have been released.
Finally, delegate the freeing of the structure to the device release
function, instead of freeing immediately in the disconnect callback.
📍 영향받는 시스템
Linux kernel (greybus: raw 구성 요소 포함 버전)
⚔️ 공격 벡터
로컬 공격자가 특정 장치 연결 해제 시나리오를 유도하여 커널 패닉 유발
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인