🇰🇷 한글 설명
Linux 커널의 L2TP 프로토콜에서 세션 삭제 시 RCU 리스트 관리 오류로 인해 발생하는 취약점입니다. 권한이 낮은 로컬 사용자가 특정 명령을 동시에 실행하면 CPU를 무한 루프에 빠뜨려 시스템을 마비시킬 수 있습니다.
💡 쉬운 설명
컴퓨터의 핵심 부품인 CPU가 특정 작업을 처리하다가 길을 잃고 영원히 같은 자리를 맴돌게 만드는 버그입니다. 이로 인해 컴퓨터가 멈추거나 응답하지 않는 상태가 될 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
l2tp: use list_del_rcu in l2tp_session_unhash
An unprivileged local user can pin a host CPU indefinitely in
l2tp_session_get_by_ifname() by issuing L2TP_CMD_SESSION_GET on
L2TP_ATTR_IFNAME concurrently with L2TP_CMD_SESSION_CREATE and
L2TP_CMD_SESSION_DELETE on the same tunnel. All three commands take
GENL_UNS_ADMIN_PERM, so CAP_NET_ADMIN in the netns user namespace
suffices; on any host that has l2tp_core loaded the trigger is
reachable from a standard `unshare -Urn` sandbox.
l2tp_session_unhash() removes a session from tunnel->session_list
with list_del_init(), but that list is walked by
l2tp_session_get_by_ifname() with list_for_each_entry_rcu() under
rcu_read_lock_bh(). list_del_init() leaves the deleted entry's
next/prev self-pointing; a reader that has loaded the entry and
then advances pos->list.next reads &session->list, container_of()s
back to the same session, and list_for_each_entry_rcu() never
reaches the list head. The CPU stays in strcmp() inside the
walker, with BH and preemption disabled, so RCU grace periods on
the host stall behind it and the wedged thread cannot be killed
(SIGKILL is delivered on syscall return).
Use list_del_rcu() to match the existing list_add_rcu() in
l2tp_session_register(); the deleted session remains visible to
in-flight walkers with consistent next/prev pointers until
kfree_rcu() in l2tp_session_free() releases it. tunnel->session_list
has exactly one list_del_init() call site; the list_del_init
(&session->clist) at l2tp_core.c:533 operates on the per-collision
list, which is not walked under RCU. list_empty(&session->list) is
not used anywhere in net/l2tp/ after the unhash point, so dropping
the post-delete self-init is safe; the fix has no userspace-visible
behavior change.
📍 영향받는 시스템
L2TP 코어가 로드된 Linux 커널 (l2tp_core 모듈 사용 시스템)
⚔️ 공격 벡터
네트워크 네임스페이스 권한을 가진 로컬 사용자가 L2TP 세션 생성, 조회, 삭제 명령을 동시에 실행하여 트리거
🛡️ 대응 방법
list_del_init() 대신 list_del_rcu()를 사용하도록 커널 패치 적용
🔧 검증 코드
커널 버전과 l2tp_core 모듈 로드 여부를 확인하여 해당 취약점이 노출될 수 있는 환경인지 판단
uname -r && lsmod | grep l2tp_core