Commit 7ca5254
net_sched: sch_sfq: reject invalid perturb period
Gerrard Tai reported that SFQ perturb_period has no range check yet,
and this can be used to trigger a race condition fixed in a separate patch.
We want to make sure ctl->perturb_period * HZ will not overflow
and is positive.
Tested:
tc qd add dev lo root sfq perturb -10 # negative value : error
Error: sch_sfq: invalid perturb period.
tc qd add dev lo root sfq perturb 1000000000 # too big : error
Error: sch_sfq: invalid perturb period.
tc qd add dev lo root sfq perturb 2000000 # acceptable value
tc -s -d qd sh dev lo
qdisc sfq 8005: root refcnt 2 limit 127p quantum 64Kb depth 127 flows 128 divisor 1024 perturb 2000000sec
Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
backlog 0b 0p requeues 0
Fixes: 1da177e ("Linux-2.6.12-rc2")
Reported-by: Gerrard Tai <[email protected]>
Signed-off-by: Eric Dumazet <[email protected]>
Cc: [email protected]
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>1 parent d4e6cb3 commit 7ca5254
1 file changed
+8
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
656 | 656 | | |
657 | 657 | | |
658 | 658 | | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
659 | 667 | | |
660 | 668 | | |
661 | 669 | | |
| |||
672 | 680 | | |
673 | 681 | | |
674 | 682 | | |
675 | | - | |
676 | 683 | | |
677 | 684 | | |
678 | 685 | | |
679 | 686 | | |
680 | 687 | | |
681 | 688 | | |
682 | | - | |
683 | 689 | | |
684 | 690 | | |
685 | 691 | | |
| |||
0 commit comments