1
0
Fork 0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-01-22 07:53:11 -05:00
linux/net/sched
Toke Høiland-Jørgensen 737d4d91d3 sched: sch_cake: add bounds checks to host bulk flow fairness counts
Even though we fixed a logic error in the commit cited below, syzbot
still managed to trigger an underflow of the per-host bulk flow
counters, leading to an out of bounds memory access.

To avoid any such logic errors causing out of bounds memory accesses,
this commit factors out all accesses to the per-host bulk flow counters
to a series of helpers that perform bounds-checking before any
increments and decrements. This also has the benefit of improving
readability by moving the conditional checks for the flow mode into
these helpers, instead of having them spread out throughout the
code (which was the cause of the original logic error).

As part of this change, the flow quantum calculation is consolidated
into a helper function, which means that the dithering applied to the
ost load scaling is now applied both in the DRR rotation and when a
sparse flow's quantum is first initiated. The only user-visible effect
of this is that the maximum packet size that can be sent while a flow
stays sparse will now vary with +/- one byte in some cases. This should
not make a noticeable difference in practice, and thus it's not worth
complicating the code to preserve the old behaviour.

Fixes: 546ea84d07 ("sched: sch_cake: fix bulk flow accounting logic for host fairness")
Reported-by: syzbot+f63600d288bfb7057424@syzkaller.appspotmail.com
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Acked-by: Dave Taht <dave.taht@gmail.com>
Link: https://patch.msgid.link/20250107120105.70685-1-toke@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-01-09 08:18:41 -08:00
..
act_api.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-10-25 09:08:22 +02:00
act_bpf.c
act_connmark.c
act_csum.c
act_ct.c net: convert to nla_get_*_default() 2024-11-11 10:32:06 -08:00
act_ctinfo.c net: convert to nla_get_*_default() 2024-11-11 10:32:06 -08:00
act_gact.c
act_gate.c net: convert to nla_get_*_default() 2024-11-11 10:32:06 -08:00
act_ife.c
act_meta_mark.c
act_meta_skbprio.c
act_meta_skbtcindex.c
act_mirred.c
act_mpls.c net: convert to nla_get_*_default() 2024-11-11 10:32:06 -08:00
act_nat.c
act_pedit.c
act_police.c net: convert to nla_get_*_default() 2024-11-11 10:32:06 -08:00
act_sample.c
act_simple.c
act_skbedit.c
act_skbmod.c
act_tunnel_key.c
act_vlan.c
cls_api.c net: sched: cls_api: improve the error message for ID allocation failure 2024-11-12 12:58:31 +01:00
cls_basic.c
cls_bpf.c
cls_cgroup.c
cls_flow.c net_sched: cls_flow: validate TCA_FLOW_RSHIFT attribute 2025-01-04 08:49:36 -08:00
cls_flower.c net: sched: fix erspan_opt settings in cls_flower 2024-12-04 10:35:14 +00:00
cls_fw.c
cls_matchall.c
cls_route.c
cls_u32.c net: sched: cls_u32: Fix u32's systematic failure to free IDR entries for hnodes. 2024-11-12 18:26:03 -08:00
em_canid.c
em_cmp.c
em_ipset.c
em_ipt.c
em_meta.c
em_nbyte.c
em_text.c
em_u32.c
ematch.c
Kconfig
Makefile
sch_api.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-10-31 18:10:07 -07:00
sch_blackhole.c
sch_cake.c sched: sch_cake: add bounds checks to host bulk flow fairness counts 2025-01-09 08:18:41 -08:00
sch_cbs.c net/sched: cbs: Fix integer overflow in cbs_set_port_rate() 2024-10-15 18:25:47 -07:00
sch_choke.c net: sched: fix ordering of qlen adjustment 2024-12-04 12:54:22 +00:00
sch_codel.c
sch_drr.c
sch_etf.c
sch_ets.c
sch_fifo.c
sch_fq.c net_sched: sch_fq: don't follow the fast path if Tx is behind now 2024-11-28 10:11:59 +01:00
sch_fq_codel.c
sch_fq_pie.c
sch_frag.c
sch_generic.c net: fix races in netdev_tx_sent_queue()/dev_watchdog() 2024-10-21 12:54:25 +02:00
sch_gred.c net: convert to nla_get_*_default() 2024-11-11 10:32:06 -08:00
sch_hfsc.c
sch_hhf.c
sch_htb.c net: convert to nla_get_*_default() 2024-11-11 10:32:06 -08:00
sch_ingress.c
sch_mq.c
sch_mqprio.c
sch_mqprio_lib.c
sch_mqprio_lib.h
sch_multiq.c
sch_netem.c net/sched: netem: account for backlog updates from child qdisc 2024-12-11 20:26:37 -08:00
sch_pie.c
sch_plug.c
sch_prio.c
sch_qfq.c net: convert to nla_get_*_default() 2024-11-11 10:32:06 -08:00
sch_red.c net: convert to nla_get_*_default() 2024-11-11 10:32:06 -08:00
sch_sfb.c
sch_sfq.c net_sched: sch_sfq: handle bigger packets 2024-10-09 19:50:31 -07:00
sch_skbprio.c
sch_taprio.c net: convert to nla_get_*_default() 2024-11-11 10:32:06 -08:00
sch_tbf.c net/sched: tbf: correct backlog statistic for GSO packets 2024-11-30 13:02:43 -08:00
sch_teql.c