В ядре Linux была устранена следующая уязвимость: net/sched: bound qdisc_pkt_len для предотвращения qdisc soft lockup qdisc_get_stab() принимает пользовательскую таблицу размеров, а __qdisc_calculate_pkt_len() усиливает qdisc_pkt_len() через накладные расходы, данные таблицы размеров (u16), и size_log (до STAB_SIZE_LOG_MAX). Таким образом, обработанный удар может установить qdisc_pkt_len() на 1 GiB для обычного skb. Планировщики дефицита Per-flow, такие как DRR и ETS, пополняют одну квантовую итерацию на цикл; с крошечным квантовым (1) они вращаются миллиарды раз под замком qdisc, создавая мягкую блокировку / RCU, как показано на veganebusec.ai.
Замкните конечный qdisc_pkt_len() на QDISC_PKT_LEN_MAX, так что увеличение размера таблицы не может привести планировщики дефицита в неограниченный цикл. Законная таблица размеров (например, накладные расходы qfq 9999999, которые обрабатываются путем выпадения) по-прежнему принимается. Введите крышку QDISC_PKT_LEN_MAX (1 20) 1 MiB, которая значительно превышает любую законную длину провода: самый большой текущий skb->len - GSO_MAX_SIZE (524280), а таблица размеров в стиле ATM (налог на ячейку 53/48) усиливает это до 578 KB, оба комфортно ниже 1 MiB.
В то же время, 1 MiB ограничивает цикл пополнения дефицита до 1M итераций на пакет с quantum1, который завершается за несколько миллисекунд хорошо под продемонстрированным порогом softlockup (109 итераций). Conditions to recreate the bug: - CONFIG_NET_SCHED=y, CONFIG_NET_SCH_DRR=y (or CONFIG_NET_SCH_ETS=y). - Attach a DRR (or ETS) root qdisc with a crafted TCA_STAB that amplifies qdisc_pkt_len to ~1 GiB (e.g. size_log=15, data=[32768]). - Add a class with a tiny quantum of 1 and send one small packet; the deficit loop spins billions of times under the qdisc lock and trips the softlockup detector (panic with kernel.softlockup_panic=1). - Reachable as root or from an unprivileged user in a fresh user+net namespace (unshare -Urn) with namespace-local CAP_NET_ADMIN.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: net/sched: bound qdisc_pkt_len to prevent qdisc soft lockup qdisc_get_stab() accepts a user-supplied size table, and __qdisc_calculate_pkt_len() amplifies qdisc_pkt_len() through the overhead, the size-table data (u16), and size_log (up to STAB_SIZE_LOG_MAX). A crafted stab can therefore set qdisc_pkt_len() to ~1 GiB for an ordinary skb. Per-flow deficit schedulers such as DRR and ETS replenish one quantum per loop iteration; with a tiny quantum (1) they spin billions of times under the qdisc lock, producing a soft lockup / RCU stall as illustrated by vega@nebusec.ai. Cap the final qdisc_pkt_len() to QDISC_PKT_LEN_MAX so the size-table amplification cannot drive deficit schedulers into an unbounded loop. A legitimate size table (e.g. qfq's overhead 999999999, which is handled by dropping) is still accepted. Introduce cap QDISC_PKT_LEN_MAX (1 << 20) = 1 MiB which is well above any legitimate single-skb wire length: the largest current skb->len is GSO_MAX_SIZE (524280), and an ATM-style size table (53/48 cell tax) amplifies that to ~578 KB, both comfortably below 1 MiB. At the same time, 1 MiB bounds the deficit refill loop to ~1M iterations per packet with quantum=1, which completes in a few milliseconds well under the demonstrated softlockup threshold (~10^9 iterations). Conditions to recreate the bug: - CONFIG_NET_SCHED=y, CONFIG_NET_SCH_DRR=y (or CONFIG_NET_SCH_ETS=y). - Attach a DRR (or ETS) root qdisc with a crafted TCA_STAB that amplifies qdisc_pkt_len to ~1 GiB (e.g. size_log=15, data=[32768]). - Add a class with a tiny quantum of 1 and send one small packet; the deficit loop spins billions of times under the qdisc lock and trips the softlockup detector (panic with kernel.softlockup_panic=1). - Reachable as root or from an unprivileged user in a fresh user+net namespace (unshare -Urn) with namespace-local CAP_NET_ADMIN.