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: <20250407121409.GC395307@horms.kernel.org>
Date: Mon, 7 Apr 2025 13:14:09 +0100
From: Simon Horman <horms@...nel.org>
To: Cong Wang <xiyou.wangcong@...il.com>
Cc: netdev@...r.kernel.org, jhs@...atatu.com, jiri@...nulli.us,
	victor@...atatu.com, Gerrard Tai <gerrard.tai@...rlabs.sg>
Subject: Re: [Patch net v2 05/11] sch_ets: make est_qlen_notify() idempotent

On Thu, Apr 03, 2025 at 02:10:27PM -0700, Cong Wang wrote:
> est_qlen_notify() deletes its class from its active list with

nit: ets_class_qlen_notify()

> list_del() when qlen is 0, therefore, it is not idempotent and
> not friendly to its callers, like fq_codel_dequeue().
> 
> Let's make it idempotent to ease qdisc_tree_reduce_backlog() callers'
> life. Also change other list_del()'s to list_del_init() just to be
> extra safe.
> 
> Reported-by: Gerrard Tai <gerrard.tai@...rlabs.sg>
> Signed-off-by: Cong Wang <xiyou.wangcong@...il.com>
> ---
>  net/sched/sch_ets.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/net/sched/sch_ets.c b/net/sched/sch_ets.c
> index 516038a44163..c3bdeb14185b 100644
> --- a/net/sched/sch_ets.c
> +++ b/net/sched/sch_ets.c
> @@ -293,7 +293,7 @@ static void ets_class_qlen_notify(struct Qdisc *sch, unsigned long arg)
>  	 * to remove them.
>  	 */
>  	if (!ets_class_is_strict(q, cl) && sch->q.qlen)
> -		list_del(&cl->alist);
> +		list_del_init(&cl->alist);
>  }
>  
>  static int ets_class_dump(struct Qdisc *sch, unsigned long arg,
> @@ -488,7 +488,7 @@ static struct sk_buff *ets_qdisc_dequeue(struct Qdisc *sch)
>  			if (unlikely(!skb))
>  				goto out;
>  			if (cl->qdisc->q.qlen == 0)
> -				list_del(&cl->alist);
> +				list_del_init(&cl->alist);
>  			return ets_qdisc_dequeue_skb(sch, skb);
>  		}
>  
> @@ -657,7 +657,7 @@ static int ets_qdisc_change(struct Qdisc *sch, struct nlattr *opt,
>  	}
>  	for (i = q->nbands; i < oldbands; i++) {
>  		if (i >= q->nstrict && q->classes[i].qdisc->q.qlen)
> -			list_del(&q->classes[i].alist);
> +			list_del_init(&q->classes[i].alist);
>  		qdisc_tree_flush_backlog(q->classes[i].qdisc);
>  	}
>  	WRITE_ONCE(q->nstrict, nstrict);
> @@ -713,7 +713,7 @@ static void ets_qdisc_reset(struct Qdisc *sch)
>  
>  	for (band = q->nstrict; band < q->nbands; band++) {
>  		if (q->classes[band].qdisc->q.qlen)
> -			list_del(&q->classes[band].alist);
> +			list_del_init(&q->classes[band].alist);
>  	}
>  	for (band = 0; band < q->nbands; band++)
>  		qdisc_reset(q->classes[band].qdisc);
> -- 
> 2.34.1
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ