lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <hx253TcI4I55RNMXolN6TJgZIJDge0mfDHoTzM4x69-mZwEL-AGh3pXbhRcWhbKaCitqPL8ljB74UTpyxyduNSpBjPR0wSFBAdRNvv7Tgoc=@willsroot.io>
Date: Fri, 25 Jul 2025 19:21:25 +0000
From: William Liu <will@...lsroot.io>
To: Cong Wang <xiyou.wangcong@...il.com>
Cc: netdev@...r.kernel.org, jhs@...atatu.com, pabeni@...hat.com, kuba@...nel.org, jiri@...nulli.us, davem@...emloft.net, edumazet@...gle.com, horms@...nel.org, savy@...t3mfailure.io
Subject: Re: [PATCH net v2 1/2] net/sched: Fix backlog accounting in qdisc_dequeue_internal

On Friday, July 25th, 2025 at 6:56 PM, Cong Wang <xiyou.wangcong@...il.com> wrote:

> 
> 
> On Thu, Jul 24, 2025 at 04:55:27PM +0000, William Liu wrote:
> 
> > diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c
> > index 2a0f3a513bfa..f9e6d76a1712 100644
> > --- a/net/sched/sch_fq_codel.c
> > +++ b/net/sched/sch_fq_codel.c
> > @@ -286,6 +286,10 @@ static struct sk_buff *fq_codel_dequeue(struct Qdisc *sch)
> > struct fq_codel_flow *flow;
> > struct list_head *head;
> > 
> > + /* reset these here, as change needs them for proper accounting*/
> > + q->cstats.drop_count = 0;
> > + q->cstats.drop_len = 0;
> > +
> > begin:
> > head = &q->new_flows;
> > if (list_empty(head)) {
> > @@ -319,8 +323,6 @@ static struct sk_buff *fq_codel_dequeue(struct Qdisc *sch)
> > if (q->cstats.drop_count) {
> > qdisc_tree_reduce_backlog(sch, q->cstats.drop_count,
> > q->cstats.drop_len);
> > - q->cstats.drop_count = 0;
> > - q->cstats.drop_len = 0;
> 
> 
> 
> Is this change really necessary? This could impact more than just the "shrinking
> to the limit" code path. We need to minimize the the impact of the patch since it
> is targeting -net and -stable.
> 
> The rest looks good to me.
> 
> Thanks for your patch!

I think so, else qdisc_tree_reduce_backlog after the code path for shrinking to the limit would have incorrect arguments if the drop path ever happens inside fq_codel_dequeue, which qdisc_dequeue_internal uses on an empty gso_skb.

The alternative is to add additional book-keeping fields in the struct for this one case, but I don't see cstats.drop_len or cstats.drop_count used elsewhere.

Best,
Will

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ