Commit 85bf037
committed
net/sched: taprio: make q->picos_per_byte available to fill_sched_entry()
JIRA: https://issues.redhat.com/browse/RHEL-44375
JIRA: https://issues.redhat.com/browse/RHEL-45534
CVE: CVE-2024-36244
Upstream Status: net.git commit e634134
commit e634134
Author: Vladimir Oltean <vladimir.oltean@nxp.com>
Date: Mon May 27 18:39:54 2024 +0300
net/sched: taprio: make q->picos_per_byte available to fill_sched_entry()
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>
Signed-off-by: Davide Caratti <dcaratti@redhat.com>1 parent afc1e64 commit 85bf037
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 | |
|---|---|---|---|
| |||
1871 | 1871 | | |
1872 | 1872 | | |
1873 | 1873 | | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
1874 | 1877 | | |
1875 | 1878 | | |
1876 | 1879 | | |
| |||
1930 | 1933 | | |
1931 | 1934 | | |
1932 | 1935 | | |
1933 | | - | |
1934 | 1936 | | |
1935 | 1937 | | |
1936 | 1938 | | |
| |||
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