🇰🇷 한글 설명
Linux 커널의 clsact qdisc 초기화 및 해제 과정에서 발생하는 비대칭성으로 인해 Use-After-Free 취약점이 발생합니다. 초기화 도중 오류가 발생하여 clsact_destroy()가 호출될 때, 이미 해제된 메모리 영역에 접근할 수 있는 결함이 존재합니다.
💡 쉬운 설명
컴퓨터의 네트워크 관리 기능이 작동을 시작하다가 중간에 오류가 나면, 이미 사용이 끝난 메모리 공간을 다시 건드려 시스템이 불안정해질 수 있는 문제입니다. 이로 인해 시스템이 멈추거나 보안 문제가 생길 수 있습니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
clsact: Fix use-after-free in init/destroy rollback asymmetry
Fix a use-after-free in the clsact qdisc upon init/destroy rollback asymmetry.
The latter is achieved by first fully initializing a clsact instance, and
then in a second step having a replacement failure for the new clsact qdisc
instance. clsact_init() initializes ingress first and then takes care of the
egress part. This can fail midway, for example, via tcf_block_get_ext(). Upon
failure, the kernel will trigger the clsact_destroy() callback.
Commit 1cb6f0bae504 ("bpf: Fix too early release of tcx_entry") details the
way how the transition is happening. If tcf_block_get_ext on the q->ingress_block
ends up failing, we took the tcx_miniq_inc reference count on the ingress
side, but not yet on the egress side. clsact_destroy() tests whether the
{ingress,egress}_entry was non-NULL. However, even in midway failure on the
replacement, both are in fact non-NULL with a valid egress_entry from the
previous clsact instance.
What we really need to test for is whether the qdisc instance-specific ingress
or egress side previously got initialized. This adds a small helper for checking
the miniq initialization called mini_qdisc_pair_inited, and utilizes that upon
clsact_destroy() in order to fix the use-after-free scenario. Convert the
ingress_destroy() side as well so both are consistent to each other.
📍 영향받는 시스템
Linux kernel (clsact qdisc 관련 모듈 사용 시스템)
⚔️ 공격 벡터
네트워크 설정 변경 중 의도적으로 초기화 실패를 유도하여 메모리 오류 발생
🛡️ 대응 방법
커널 패치(Commit 1cb6f0bae504 포함 버전)를 적용하여 최신 커널로 업데이트
🔧 검증 코드
출력된 커널 버전이 취약점이 해결된 패치 버전 이후인지 확인