🔍 CVE-2024-46828

7.1
CVSS Score
HIGH
2024-09-27
2026-08-04 11:20
✅ 완료

🇰🇷 한글 설명

Linux 커널의 sch_cake 스케줄러에서 호스트 공정성(host fairness) 모드와 해시 충돌 처리 로직 간의 상호작용으로 인해 발생하는 취약점입니다. 해시 충돌 시 불필요한 카운터 감소가 발생하여 값이 최대치로 되돌아가는 언더플로우(wrap-around)가 발생할 수 있으며, 이는 배열 인덱스 범위를 벗어난 메모리 접근을 유발할 수 있습니다.

💡 쉬운 설명

네트워크 데이터를 처리하는 과정에서 계산 오류로 인해 숫자가 갑자기 매우 커지는 현상이 발생할 수 있습니다. 이 오류를 이용하면 시스템의 메모리 영역을 잘못 건드려 보안 문제를 일으킬 수 있습니다.

🇺🇸 원문 (English)

In the Linux kernel, the following vulnerability has been resolved: sched: sch_cake: fix bulk flow accounting logic for host fairness In sch_cake, we keep track of the count of active bulk flows per host, when running in dst/src host fairness mode, which is used as the round-robin weight when iterating through flows. The count of active bulk flows is updated whenever a flow changes state. This has a peculiar interaction with the hash collision handling: when a hash collision occurs (after the set-associative hashing), the state of the hash bucket is simply updated to match the new packet that collided, and if host fairness is enabled, that also means assigning new per-host state to the flow. For this reason, the bulk flow counters of the host(s) assigned to the flow are decremented, before new state is assigned (and the counters, which may not belong to the same host anymore, are incremented again). Back when this code was introduced, the host fairness mode was always enabled, so the decrement was unconditional. When the configuration flags were introduced the *increment* was made conditional, but the *decrement* was not. Which of course can lead to a spurious decrement (and associated wrap-around to U16_MAX). AFAICT, when host fairness is disabled, the decrement and wrap-around happens as soon as a hash collision occurs (which is not that common in itself, due to the set-associative hashing). However, in most cases this is harmless, as the value is only used when host fairness mode is enabled. So in order to trigger an array overflow, sch_cake has to first be configured with host fairness disabled, and while running in this mode, a hash collision has to occur to cause the overflow. Then, the qdisc has to be reconfigured to enable host fairness, which leads to the array out-of-bounds because the wrapped-around value is retained and used as an array index. It seems that syzbot managed to trigger this, which is quite impressive in its own right. This patch fixes the issue by introducing the same conditional check on decrement as is used on increment. The original bug predates the upstreaming of cake, but the commit listed in the Fixes tag touched that code, meaning that this patch won't apply before that.

📍 영향받는 시스템

Linux kernel (sch_cake 스케줄러를 사용하는 환경)

⚔️ 공격 벡터

특정 네트워크 설정(host fairness 비활성화) 상태에서 해시 충돌을 유도한 후, 설정을 변경하여 배열 인덱스 범위를 벗어난 메모리 접근 유도

🛡️ 대응 방법

Linux 커널을 최신 보안 패치가 적용된 버전으로 업데이트하여 sch_cake의 카운터 감소 로직을 수정해야 합니다.

🔧 검증 코드

출력된 커널 버전이 해당 취약점이 수정된 최신 패치 버전인지 확인합니다.

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:N/A:H

💻 영향받는 소프트웨어

Linux Kernel