Commit 839dd53
committed
net/sched: taprio: make q->picos_per_byte available to fill_sched_entry()
jira LE-2015
cve CVE-2024-36244
Rebuild_History Non-Buildable kernel-5.14.0-427.42.1.el9_4
commit-author Vladimir Oltean <vladimir.oltean@nxp.com>
commit e634134
In commit b5b73b2 ("taprio: Fix allowing too small intervals"), a
comparison of user input against length_to_duration(q, ETH_ZLEN) was
introduced, to avoid RCU stalls due to frequent hrtimers.
The implementation of length_to_duration() depends on q->picos_per_byte
being set for the link speed. The blamed commit in the Fixes: tag has
moved this too late, so the checks introduced above are ineffective.
The q->picos_per_byte is zero at parse_taprio_schedule() ->
parse_sched_list() -> parse_sched_entry() -> fill_sched_entry() time.
Move the taprio_set_picos_per_byte() call as one of the first things in
taprio_change(), before the bulk of the netlink attribute parsing is
done. That's because it is needed there.
Add a selftest to make sure the issue doesn't get reintroduced.
Fixes: 09dbdf2 ("net/sched: taprio: fix calculation of maximum gate durations")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20240527153955.553333-1-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
(cherry picked from commit e634134)
Signed-off-by: Jonathan Maple <jmaple@ciq.com>1 parent e061230 commit 839dd53
File tree
2 files changed
+25
-1
lines changed- net/sched
- tools/testing/selftests/tc-testing/tc-tests/qdiscs
2 files changed
+25
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1870 | 1870 | | |
1871 | 1871 | | |
1872 | 1872 | | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
1873 | 1876 | | |
1874 | 1877 | | |
1875 | 1878 | | |
| |||
1929 | 1932 | | |
1930 | 1933 | | |
1931 | 1934 | | |
1932 | | - | |
1933 | 1935 | | |
1934 | 1936 | | |
1935 | 1937 | | |
| |||
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
135 | 157 | | |
136 | 158 | | |
137 | 159 | | |
| |||
0 commit comments