🔍 CVE-2025-21899

7.8
CVSS Score
HIGH
2025-04-01
2026-10-15 22:18
✅ 완료

🇰🇷 한글 설명

리눅스 커널의 tracing 기능에서 히스토그램 트리거 등록 중 오류가 발생할 경우, 등록된 트리거가 리스트에서 제대로 제거되지 않는 취약점입니다. 이로 인해 메모리 해제 후에도 리스트에 남아있는 Use-After-Free(UAF) 상태가 발생하여 시스템 충돌이나 커널 패닉을 유발할 수 있습니다.

💡 쉬운 설명

시스템의 기록 기능을 설정하다가 오류가 나면, 지워져야 할 데이터가 메모리에 찌꺼기처럼 남게 됩니다. 나중에 이 찌꺼기를 다시 사용하려고 하면 컴퓨터가 갑자기 멈추거나 꺼질 수 있습니다.

🇺🇸 원문 (English)

In the Linux kernel, the following vulnerability has been resolved: tracing: Fix bad hist from corrupting named_triggers list The following commands causes a crash: ~# cd /sys/kernel/tracing/events/rcu/rcu_callback ~# echo 'hist:name=bad:keys=common_pid:onmax(bogus).save(common_pid)' > trigger bash: echo: write error: Invalid argument ~# echo 'hist:name=bad:keys=common_pid' > trigger Because the following occurs: event_trigger_write() { trigger_process_regex() { event_hist_trigger_parse() { data = event_trigger_alloc(..); event_trigger_register(.., data) { cmd_ops->reg(.., data, ..) [hist_register_trigger()] { data->ops->init() [event_hist_trigger_init()] { save_named_trigger(name, data) { list_add(&data->named_list, &named_triggers); } } } } ret = create_actions(); (return -EINVAL) if (ret) goto out_unreg; [..] ret = hist_trigger_enable(data, ...) { list_add_tail_rcu(&data->list, &file->triggers); <<<---- SKIPPED!!! (this is important!) [..] out_unreg: event_hist_unregister(.., data) { cmd_ops->unreg(.., data, ..) [hist_unregister_trigger()] { list_for_each_entry(iter, &file->triggers, list) { if (!hist_trigger_match(data, iter, named_data, false)) <- never matches continue; [..] test = iter; } if (test && test->ops->free) <<<-- test is NULL test->ops->free(test) [event_hist_trigger_free()] { [..] if (data->name) del_named_trigger(data) { list_del(&data->named_list); <<<<-- NEVER gets removed! } } } } [..] kfree(data); <<<-- frees item but it is still on list The next time a hist with name is registered, it causes an u-a-f bug and the kernel can crash. Move the code around such that if event_trigger_register() succeeds, the next thing called is hist_trigger_enable() which adds it to the list. A bunch of actions is called if get_named_trigger_data() returns false. But that doesn't need to be called after event_trigger_register(), so it can be moved up, allowing event_trigger_register() to be called just before hist_trigger_enable() keeping them together and allowing the file->triggers to be properly populated.

📍 영향받는 시스템

Linux Kernel (tracing 기능이 활성화된 버전)

⚔️ 공격 벡터

특정 형식을 갖춘 잘못된 히스토그램 트리거 명령어를 /sys/kernel/tracing/events/... 경로에 입력하여 트리거 등록 실패를 유도함

🛡️ 대응 방법

리눅스 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 트리거 등록 및 해제 로직을 수정해야 함

🔧 검증 코드

출력된 커널 버전이 해당 취약점이 해결된 최신 패치 버전인지 확인하십시오.

Shell / Script
uname -r

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

💻 영향받는 소프트웨어

Linux Kernel