🇰🇷 한글 설명
리눅스 커널의 브리지 네트워크 모듈에서 포트를 제거할 때 이전 가비지 컬렉션(GC) 사이클이 완료되었는지 확인하지 않아 발생하는 Use-After-Free 취약점입니다. 이로 인해 포트가 해제된 후에도 타이머가 실행되면서 메모리 오류를 유발할 수 있습니다.
💡 쉬운 설명
네트워크 연결을 끊을 때, 시스템이 아직 사용 중인 데이터를 정리하기도 전에 연결 정보를 먼저 지워버려서 발생하는 문제입니다. 이로 인해 시스템이 엉뚱한 메모리 주소를 참조하게 되어 오류가 발생하거나 보안 문제가 생길 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
net: bridge: mcast: wait for previous gc cycles when removing port
syzbot hit a use-after-free[1] which is caused because the bridge doesn't
make sure that all previous garbage has been collected when removing a
port. What happens is:
CPU 1 CPU 2
start gc cycle remove port
acquire gc lock first
wait for lock
call br_multicasg_gc() directly
acquire lock now but free port
the port can be freed
while grp timers still
running
Make sure all previous gc cycles have finished by using flush_work before
freeing the port.
[1]
BUG: KASAN: slab-use-after-free in br_multicast_port_group_expired+0x4c0/0x550 net/bridge/br_multicast.c:861
Read of size 8 at addr ffff888071d6d000 by task syz.5.1232/9699
CPU: 1 PID: 9699 Comm: syz.5.1232 Not tainted 6.10.0-rc5-syzkaller-00021-g24ca36a562d6 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024
Call Trace:
<IRQ>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114
print_address_description mm/kasan/report.c:377 [inline]
print_report+0xc3/0x620 mm/kasan/report.c:488
kasan_report+0xd9/0x110 mm/kasan/report.c:601
br_multicast_port_group_expired+0x4c0/0x550 net/bridge/br_multicast.c:861
call_timer_fn+0x1a3/0x610 kernel/time/timer.c:1792
expire_timers kernel/time/timer.c:1843 [inline]
__run_timers+0x74b/0xaf0 kernel/time/timer.c:2417
__run_timer_base kernel/time/timer.c:2428 [inline]
__run_timer_base kernel/time/timer.c:2421 [inline]
run_timer_base+0x111/0x190 kernel/time/timer.c:2437
📍 영향받는 시스템
Linux kernel (specifically versions prior to the fix, including 6.10.0-rc5 and affected bridge module)
⚔️ 공격 벡터
로컬 공격자가 특정 네트워크 브리지 환경에서 포트 제거와 가비지 컬렉션 타이머를 정교하게 조작하여 발생 가능
🛡️ 대응 방법
포트를 해제하기 전에 flush_work를 사용하여 모든 이전 가비지 컬렉션 작업이 완료되었는지 확인하도록 커널을 업데이트해야 합니다.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 패치된 버전인지 공식 보안 공지(Linux Kernel Mailing List 등)와 대조하여 확인하십시오.