🇰🇷 한글 설명
Linux 커널의 net/sched 모듈 em_text 함수에서, 알고리즘 이름 배열(algo[])에 NUL 종료 문자가 없을 때 TS_AUTOLOAD 재시도 과정의 request_module 호출이 배열 범위를 넘어 읽어 커널 메모리 일부가 usermode helper 명령줄로 노출될 수 있는 결함입니다. 이를 막기 위해 TC_EM_TEXT_ALGOSIZ 바이트 내에 NUL이 없으면 속성을 거부하도록 수정되었습니다.
💡 쉬운 설명
네트워크 트래픽 필터를 설정하는 과정에서 입력값 검사가 부족해 커널 메모리 일부가 외부로 새어 나갈 수 있습니다. 관리자 권한이 필요하며, 최신 커널 패치를 적용하면 해결됩니다.
🇺🇸 원문 (English)
In the Linux kernel, the following vulnerability has been resolved:
net/sched: em_text: reject unterminated algo before autoload
This is a follow-up to commit 9c572a83037a ("net/sched: fix potential
stack infoleak in em_text_dump()"), which zero-initialised the dump-side
struct. Sashiko pointed at a pre-existing bug that exposed the change-side
input-validation gap open.
em_text_change() casts the raw netlink attribute payload to struct
tcf_em_text and passes conf->algo, a 16-byte array with no enforced NUL
terminator, to textsearch_prepare(). On the TS_AUTOLOAD retry
textsearch_prepare() calls request_module("ts_%s", algo); vsnprintf()
walks %s until it finds a NUL, so an algo[] with no NUL reads past the
array into the adjacent struct fields and payload and feeds those bytes
to the usermode helper command line. This is an out-of-bounds read and
a kernel memory disclosure.
Reject the attribute when no NUL exists within TC_EM_TEXT_ALGOSIZ bytes,
matching the check xt_string has had since 3ab720881b6e.
Conditions to recreate the bug:
- CAP_NET_ADMIN on the target netns (namespace-local via unshare -Urn
is enough)
- install clsact on an interface, then add a basic filter with one text
ematch whose algo[] is 16 bytes with no NUL (e.g. "A"*16) and
pattern_len at least 1
- the add fails with -ENOENT and the kernel invokes modprobe with a
module name made of "ts_" plus the 16 bytes and the adjacent payload
📍 영향받는 시스템
수정 이전의 Linux 커널 (net/sched em_text 모듈을 포함하는 버전)
⚔️ 공격 벡터
CAP_NET_ADMIN 권한을 가진 사용자가 NUL 종료 없는 16바이트 알고리즘 이름을 담은 text ematch 필터를 추가하여 커널 메모리를 노출시킴
🛡️ 대응 방법
배포판 제공 보안 업데이트 또는 해당 수정 커밋이 포함된 최신 커널로 업그레이드
🔧 검증 코드
커널 버전을 확인한 후 배포판 보안 공지에서 이 CVE의 수정 버전과 비교하여, 설치된 버전이 수정 버전 이상이면 안전하고 미만이면 업데이트가 필요합니다.