Skip to content

Commit 3f8ef3d

Browse files
committed
net: sched: delete duplicate cleanup of backlog and qlen
jira VULN-155239 cve-pre CVE-2022-50356 commit-author Zhengchao Shao <shaozhengchao@huawei.com> commit c19d893 qdisc_reset() is clearing qdisc->q.qlen and qdisc->qstats.backlog _after_ calling qdisc->ops->reset. There is no need to clear them again in the specific reset function. Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com> Link: https://lore.kernel.org/r/20220824005231.345727-1-shaozhengchao@huawei.com Signed-off-by: Paolo Abeni <pabeni@redhat.com> (cherry picked from commit c19d893) Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
1 parent 4aee973 commit 3f8ef3d

21 files changed

+0
-40
lines changed

include/net/sch_generic.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1175,7 +1175,6 @@ static inline void __qdisc_reset_queue(struct qdisc_skb_head *qh)
11751175
static inline void qdisc_reset_queue(struct Qdisc *sch)
11761176
{
11771177
__qdisc_reset_queue(&sch->q);
1178-
sch->qstats.backlog = 0;
11791178
}
11801179

11811180
static inline struct Qdisc *qdisc_replace(struct Qdisc *sch, struct Qdisc *new,

net/sched/sch_atm.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,6 @@ static void atm_tc_reset(struct Qdisc *sch)
575575
pr_debug("atm_tc_reset(sch %p,[qdisc %p])\n", sch, p);
576576
list_for_each_entry(flow, &p->flows, list)
577577
qdisc_reset(flow->q);
578-
sch->q.qlen = 0;
579578
}
580579

581580
static void atm_tc_destroy(struct Qdisc *sch)

net/sched/sch_cbq.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1058,7 +1058,6 @@ cbq_reset(struct Qdisc *sch)
10581058
cl->cpriority = cl->priority;
10591059
}
10601060
}
1061-
sch->q.qlen = 0;
10621061
}
10631062

10641063

net/sched/sch_choke.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,6 @@ static void choke_reset(struct Qdisc *sch)
319319
rtnl_qdisc_drop(skb, sch);
320320
}
321321

322-
sch->q.qlen = 0;
323-
sch->qstats.backlog = 0;
324322
if (q->tab)
325323
memset(q->tab, 0, (q->tab_mask + 1) * sizeof(struct sk_buff *));
326324
q->head = q->tail = 0;

net/sched/sch_drr.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,8 +447,6 @@ static void drr_reset_qdisc(struct Qdisc *sch)
447447
qdisc_reset(cl->qdisc);
448448
}
449449
}
450-
sch->qstats.backlog = 0;
451-
sch->q.qlen = 0;
452450
}
453451

454452
static void drr_destroy_qdisc(struct Qdisc *sch)

net/sched/sch_dsmark.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,8 +408,6 @@ static void dsmark_reset(struct Qdisc *sch)
408408
pr_debug("%s(sch %p,[qdisc %p])\n", __func__, sch, p);
409409
if (p->q)
410410
qdisc_reset(p->q);
411-
sch->qstats.backlog = 0;
412-
sch->q.qlen = 0;
413411
}
414412

415413
static void dsmark_destroy(struct Qdisc *sch)

net/sched/sch_etf.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -445,9 +445,6 @@ static void etf_reset(struct Qdisc *sch)
445445
timesortedlist_clear(sch);
446446
__qdisc_reset_queue(&sch->q);
447447

448-
sch->qstats.backlog = 0;
449-
sch->q.qlen = 0;
450-
451448
q->last = 0;
452449
}
453450

net/sched/sch_ets.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -731,8 +731,6 @@ static void ets_qdisc_reset(struct Qdisc *sch)
731731
}
732732
for (band = 0; band < q->nbands; band++)
733733
qdisc_reset(q->classes[band].qdisc);
734-
sch->qstats.backlog = 0;
735-
sch->q.qlen = 0;
736734
}
737735

738736
static void ets_qdisc_destroy(struct Qdisc *sch)

net/sched/sch_fq_codel.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,6 @@ static void fq_codel_reset(struct Qdisc *sch)
351351
codel_vars_init(&flow->cvars);
352352
}
353353
memset(q->backlogs, 0, q->flows_cnt * sizeof(u32));
354-
sch->q.qlen = 0;
355-
sch->qstats.backlog = 0;
356354
q->memory_usage = 0;
357355
}
358356

net/sched/sch_fq_pie.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -514,9 +514,6 @@ static void fq_pie_reset(struct Qdisc *sch)
514514
INIT_LIST_HEAD(&flow->flowchain);
515515
pie_vars_init(&flow->vars);
516516
}
517-
518-
sch->q.qlen = 0;
519-
sch->qstats.backlog = 0;
520517
}
521518

522519
static void fq_pie_destroy(struct Qdisc *sch)

0 commit comments

Comments
 (0)