🇰🇷 한글 설명
Linux 커널의 TIPC 프로토콜에서 tipc_node_link_down() 함수가 노드 락을 획득하기 전에 링크 포인터를 미리 읽어 발생하는 Use-After-Free 취약점입니다. 이로 인해 다른 CPU에서 링크 객체가 해제된 후 해당 메모리에 접근하여 읽기 또는 쓰기 오류가 발생할 수 있습니다.
💡 쉬운 설명
컴퓨터가 사용 중인 데이터가 다른 작업에 의해 갑자기 삭제되었음에도 불구하고, 이를 모르고 계속 사용하려고 시도할 때 발생하는 오류입니다. 이 과정에서 시스템이 충돌하거나 예상치 못한 동작을 할 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
tipc: read le->link under the node lock in tipc_node_link_down()
tipc_node_link_down() caches the link pointer before taking n->lock:
struct tipc_link *l = le->link; /* unlocked */
if (!l)
return;
tipc_node_write_lock(n);
if (!tipc_link_is_establishing(l)) { /* deref l */
...
tipc_link_reset(l); /* write into l */
if (delete) {
kfree(l);
le->link = NULL;
The delete=true caller frees that very object under n->lock, so the lock
does not protect the cached pointer against it:
- CPU A, delete=false: tipc_rcv() on TIPC_LINK_DOWN_EVT, or the link
supervision timer via tipc_node_timeout(), reads l unlocked and then
dereferences it under n->lock;
- CPU B, delete=true: netlink TIPC_NL_BEARER_DISABLE -> bearer_disable()
-> tipc_node_delete_links() -> tipc_node_link_down(n, bearer_id, true)
-> kfree(l).
The link is freed with plain kfree(), not kfree_rcu(), and for UDP bearers
disable_media() only schedules the asynchronous cleanup_bearer() work, so
its synchronize_net() runs after the links are already gone. An in-flight
CPU A that has read l therefore dereferences freed memory once B frees it:
a use-after-free read in tipc_link_is_establishing(), and a use-after-free
write via tipc_link_reset() on the establishing branch.
The following trace was captured on 7.2.0-rc5-00284-gaf39eb111ce6:
BUG: KASAN: slab-use-after-free in tipc_link_is_establishing (net/tipc/link.c:285)
Read of size 4 at addr ffff88802e2aa068 by task swapper/2/0
tipc_link_is_establishing (net/tipc/link.c:285)
tipc_node_link_down (net/tipc/node.c:1076)
tipc_node_timeout (net/tipc/node.c:843)
Allocated by task 9549:
tipc_link_create (net/tipc/link.c:490)
tipc_node_check_dest (net/tipc/node.c:1279)
tipc_disc_rcv (net/tipc/discover.c:252)
tipc_udp_recv (net/tipc/udp_media.c:389)
Freed by task 9549:
tipc_node_link_down (net/tipc/node.c:1084)
tipc_node_delete_links (net/tipc/node.c:1320)
bearer_disable (net/tipc/bearer.c:414)
__tipc_nl_bearer_disable (net/tipc/bearer.c:992)
Move the le->link read inside tipc_node_write_lock(), so it is serialised
against the kfree() in the delete path. A racing teardown now either has
not run yet, and we see a valid link, or has already run, and we see NULL.
📍 영향받는 시스템
Linux kernel (TIPC 프로토콜 사용 환경)
⚔️ 공격 벡터
TIPC 네트워크 링크의 비활성화 또는 삭제를 유도하여 레이스 컨디션(Race Condition)을 발생시킴
🛡️ 대응 방법
le->link 읽기 동작을 tipc_node_write_lock() 내부로 이동시켜 락 보호를 받도록 커널 패치 적용
🔧 검증 코드
출력된 커널 버전이 취약점이 해결된 패치 버전인지 확인