Commit f139f37
net_sched: qfq: Fix double list add in class with netem as child qdisc
As described in Gerrard's report [1], there are use cases where a netem
child qdisc will make the parent qdisc's enqueue callback reentrant.
In the case of qfq, there won't be a UAF, but the code will add the same
classifier to the list twice, which will cause memory corruption.
This patch checks whether the class was already added to the agg->active
list (cl_is_active) before doing the addition to cater for the reentrant
case.
[1] https://lore.kernel.org/netdev/CAHcdcOm+03OD2j6R0=YHKqmy=VgJ8xEOKuP6c7mSgnp-TEJJbw@mail.gmail.com/
Fixes: 37d9cf1 ("sched: Fix detection of empty queues in child qdiscs")
Acked-by: Jamal Hadi Salim <[email protected]>
Signed-off-by: Victor Nogueira <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>1 parent 1a6d0c0 commit f139f37
1 file changed
+7
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
205 | 210 | | |
206 | 211 | | |
207 | 212 | | |
| |||
1215 | 1220 | | |
1216 | 1221 | | |
1217 | 1222 | | |
1218 | | - | |
1219 | 1223 | | |
1220 | 1224 | | |
1221 | 1225 | | |
| |||
1237 | 1241 | | |
1238 | 1242 | | |
1239 | 1243 | | |
1240 | | - | |
1241 | 1244 | | |
1242 | 1245 | | |
1243 | 1246 | | |
| |||
1253 | 1256 | | |
1254 | 1257 | | |
1255 | 1258 | | |
1256 | | - | |
1257 | | - | |
| 1259 | + | |
| 1260 | + | |
1258 | 1261 | | |
1259 | 1262 | | |
1260 | 1263 | | |
| |||
0 commit comments