🇰🇷 한글 설명
리눅스 커널의 net/sched cls_api에서 발생한 레이스 컨디션 취약점으로, 새로운 필터를 삽입하는 과정에서 경쟁 상태가 발생할 경우 이미 활성화된 분류기(classifier)를 실수로 삭제할 수 있습니다. 이 문제는 삽입 과정의 상태 관리가 미흡하여 발생하며, 승리한 요청의 프로토를 패배한 요청의 것으로 오인하여 해제하는 과정에서 발생합니다.
💡 쉬운 설명
두 개의 작업이 동시에 네트워크 규칙을 만들려고 경쟁할 때, 시스템이 혼란을 일으켜 정상적으로 작동 중인 규칙을 실수로 지워버리는 문제입니다. 이로 인해 네트워크 트래픽 제어 기능이 의도치 않게 중단될 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
net/sched: cls_api: fix teardown of an adopted proto on insert-race loss
In tc_new_tfilter() the create branch sets tp_created = 1 before calling
tcf_chain_tp_insert_unique(). When the caller loses the race (another
request inserted a proto at the same chain/prio first), insert_unique()
destroys the caller's own tp_new and returns the winner's proto with an
extra reference. tp_created was never cleared, so the loser's errout
path treated the winner's live proto as its own and called
tcf_chain_tp_delete_empty() on it, silently unlinking an active
classifier that the winning request already advertised via
RTM_NEWTFILTER.
Track the outcome of the insert step in a single tri-state variable so
each errout path reacts correctly:
- TP_NOT_CREATED: no proto created; pursue the old path.
- TP_CREATED: proto inserted successfully; same code path as before.
- TP_NOT_OWNED: New - lost the insert race; tp is another request's proto
(chain ref already released by tp_new's destroy)
Both errout reactions are single expressions derived from the state.
This fix is motivated by the Sashiko's automated review of Patch
(net/sched: cls_api: Always acquire rtnl_lock when destroying locked
classifiers) [1][2]. The review identified the silent-unlink behaviour of
an adopted proto's teardown when a request loses the
tcf_chain_tp_insert_unique() race.
[1] https://sashiko.dev/#/patchset/20260801125632.360365-1-jhs%40mojatatu.com
[2] https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260801125632.360365-1-jhs%40mojatatu.com
📍 영향받는 시스템
Linux Kernel (net/sched: cls_api 관련 모듈 사용 시스템)
⚔️ 공격 벡터
동시에 다수의 tc(traffic control) 필터 삽입 요청을 보내 레이스 컨디션을 유도하여 활성 분류기를 제거함
🛡️ 대응 방법
리눅스 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 cls_api의 상태 관리 로직을 수정해야 함
🔧 검증 코드
출력된 커널 버전이 해당 취약점이 수정된 패치 버전 이후인지 확인하십시오.