🇰🇷 한글 설명
Linux 커널의 af_unix 구성 요소에서 발생하는 취약점으로, 특정 동시성 상황에서 가비지 컬렉션(GC)이 죽은 SCC(Strongly Connected Component)를 부분적으로 해제할 때 발생합니다. unix_add_edges()가 새로운 에지를 공개하지만 skb가 큐에 추가되기 전 소켓이 닫히면, 잘못된 scc_entry 참조로 인해 메모리 관리 오류가 발생할 수 있습니다.
💡 쉬운 설명
리눅스 시스템 내부에서 통신 통로를 정리하는 과정 중에 데이터가 꼬여서 발생하는 문제입니다. 특정 상황에서 시스템이 이미 사라진 연결 정보를 계속 참조하려고 시도하여 오류를 일으킬 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
af_unix: Unlink scc_entry in unix_del_edge().
Kyle Zeng reported that GC could free a dead SCC partially.
The scenario is as follows:
1) Create two SCCs:
X -. A <-> B
^--'
2) Run the following concurrently:
2-1) send() sk-B to sk-B from sk-X
2-2) close() both A and B
At 2-1), there is a small window where unix_add_edges()
publishes a new edge (B <-> B) to GC but its skb is not queued
by skb_queue_tail().
If 2-2) completes before skb_queue_tail() and GC is triggered,
it judges A <-> B as dead, but B is not freed because GC cannot
collect the not-yet-queued skb holding the B <-> B edge.
X -. A <-> B -. This edge is visible
^--' ^..' but skb is not
This itself is not a problem since the next GC run will judge
B as dead as well and free it finally.
X -. A <.> B -.
^--' ^--'
However, X's SCC forces the next GC to call unix_walk_scc_fast(),
and it iterates over A through B's scc_entry.
Let's unlink scc_entry before freeing the vertex in unix_del_edge().
📍 영향받는 시스템
Linux Kernel (af_unix 관련 모듈 사용 시스템)
⚔️ 공격 벡터
동시성 제어(Race Condition)를 이용한 로컬 공격
🛡️ 대응 방법
Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 unix_del_edge() 내 scc_entry 언링크 로직을 적용해야 합니다.
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 해결된 패치 버전 이후인지 확인합니다.