🇰🇷 한글 설명
Linux 커널의 rose_rt_device_down() 함수에서 이웃 포인터가 제대로 해제되지 않는 dangling pointer 취약점이 발견되었습니다. 루프 제어 로직의 오류로 인해 일부 항목이 누락되어 메모리가 해제된 후에도 참조되는 Use-After-Free(UAF) 문제가 발생할 수 있습니다.
💡 쉬운 설명
컴퓨터가 메모리에서 정보를 지울 때, 실수로 지워야 할 목록을 다 확인하지 못해 발생하는 문제입니다. 이로 인해 이미 사라진 정보를 다시 사용하려다 시스템이 충돌하거나 보안 문제가 생길 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
rose: fix dangling neighbour pointers in rose_rt_device_down()
There are two bugs in rose_rt_device_down() that can cause
use-after-free:
1. The loop bound `t->count` is modified within the loop, which can
cause the loop to terminate early and miss some entries.
2. When removing an entry from the neighbour array, the subsequent entries
are moved up to fill the gap, but the loop index `i` is still
incremented, causing the next entry to be skipped.
For example, if a node has three neighbours (A, A, B) with count=3 and A
is being removed, the second A is not checked.
i=0: (A, A, B) -> (A, B) with count=2
^ checked
i=1: (A, B) -> (A, B) with count=2
^ checked (B, not A!)
i=2: (doesn't occur because i < count is false)
This leaves the second A in the array with count=2, but the rose_neigh
structure has been freed. Code that accesses these entries assumes that
the first `count` entries are valid pointers, causing a use-after-free
when it accesses the dangling pointer.
Fix both issues by iterating over the array in reverse order with a fixed
loop bound. This ensures that all entries are examined and that the removal
of an entry doesn't affect subsequent iterations.
📍 영향받는 시스템
Linux Kernel (rose 모듈 사용 환경)
⚔️ 공격 벡터
특정 네트워크 장치(rose)의 연결을 해제하는 과정에서 조작된 이웃 노드 정보를 통해 메모리 오류 유도
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 rose_rt_device_down() 함수의 루프 로직 수정 적용
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인하십시오.