Skip to content

Commit 75e18b8

Browse files
committed
net: sched: delete duplicate cleanup of backlog and qlen
jira VULN-155243 cve-pre CVE-2022-50356 commit-author Zhengchao Shao <[email protected]> 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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]> (cherry picked from commit c19d893) Signed-off-by: Roxana Nicolescu <[email protected]>
1 parent 8c21356 commit 75e18b8

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
@@ -1137,7 +1137,6 @@ static inline void __qdisc_reset_queue(struct qdisc_skb_head *qh)
11371137
static inline void qdisc_reset_queue(struct Qdisc *sch)
11381138
{
11391139
__qdisc_reset_queue(&sch->q);
1140-
sch->qstats.backlog = 0;
11411140
}
11421141

11431142
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
@@ -577,7 +577,6 @@ static void atm_tc_reset(struct Qdisc *sch)
577577
pr_debug("atm_tc_reset(sch %p,[qdisc %p])\n", sch, p);
578578
list_for_each_entry(flow, &p->flows, list)
579579
qdisc_reset(flow->q);
580-
sch->q.qlen = 0;
581580
}
582581

583582
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
@@ -975,7 +975,6 @@ cbq_reset(struct Qdisc *sch)
975975
cl->cpriority = cl->priority;
976976
}
977977
}
978-
sch->q.qlen = 0;
979978
}
980979

981980

net/sched/sch_choke.c

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

318-
sch->q.qlen = 0;
319-
sch->qstats.backlog = 0;
320318
if (q->tab)
321319
memset(q->tab, 0, (q->tab_mask + 1) * sizeof(struct sk_buff *));
322320
q->head = q->tail = 0;

net/sched/sch_drr.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,6 @@ static void drr_reset_qdisc(struct Qdisc *sch)
441441
qdisc_reset(cl->qdisc);
442442
}
443443
}
444-
sch->qstats.backlog = 0;
445-
sch->q.qlen = 0;
446444
}
447445

448446
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
@@ -409,8 +409,6 @@ static void dsmark_reset(struct Qdisc *sch)
409409
pr_debug("%s(sch %p,[qdisc %p])\n", __func__, sch, p);
410410
if (p->q)
411411
qdisc_reset(p->q);
412-
sch->qstats.backlog = 0;
413-
sch->q.qlen = 0;
414412
}
415413

416414
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
@@ -347,8 +347,6 @@ static void fq_codel_reset(struct Qdisc *sch)
347347
codel_vars_init(&flow->cvars);
348348
}
349349
memset(q->backlogs, 0, q->flows_cnt * sizeof(u32));
350-
sch->q.qlen = 0;
351-
sch->qstats.backlog = 0;
352350
q->memory_usage = 0;
353351
}
354352

net/sched/sch_fq_pie.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -521,9 +521,6 @@ static void fq_pie_reset(struct Qdisc *sch)
521521
INIT_LIST_HEAD(&flow->flowchain);
522522
pie_vars_init(&flow->vars);
523523
}
524-
525-
sch->q.qlen = 0;
526-
sch->qstats.backlog = 0;
527524
}
528525

529526
static void fq_pie_destroy(struct Qdisc *sch)

0 commit comments

Comments
 (0)