netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cong Wang <xiyou.wangcong@gmail.com>
To: Xiang Mei <xmei5@asu.edu>
Cc: netdev@vger.kernel.org, gregkh@linuxfoundation.org,
	jhs@mojatatu.com, jiri@resnulli.us, security@kernel.org
Subject: Re: [PATCH v3] net/sched: sch_qfq: Fix null-deref in agg_dequeue
Date: Sat, 5 Jul 2025 20:07:32 -0700	[thread overview]
Message-ID: <aGnodC+JgY8wI9xc@pop-os.localdomain> (raw)
In-Reply-To: <20250705212143.3982664-1-xmei5@asu.edu>

On Sat, Jul 05, 2025 at 02:21:43PM -0700, Xiang Mei wrote:
> To prevent a potential crash in agg_dequeue (net/sched/sch_qfq.c)
> when cl->qdisc->ops->peek(cl->qdisc) returns NULL, we check the return
> value before using it, similar to the existing approach in sch_hfsc.c.
> 
> To avoid code duplication, the following changes are made:
> 
> 1. Changed qdisc_warn_nonwc(include/net/pkt_sched.h) into a static
> inline function.
> 
> 2. Moved qdisc_peek_len from net/sched/sch_hfsc.c to
> include/net/pkt_sched.h so that sch_qfq can reuse it.
> 
> 3. Applied qdisc_peek_len in agg_dequeue to avoid crashing.
> 
> Signed-off-by: Xiang Mei <xmei5@asu.edu>

Fixes: 462dbc9101ac ("pkt_sched: QFQ Plus: fair-queueing service at DRR cost")
Reviewed-by: Cong Wang <xiyou.wangcong@gmail.com>

Thanks!

  reply	other threads:[~2025-07-06  3:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAM_iQpWkQd_1BdP+4cA2uQ5HP2wrb5dh8ZUgGWY7v3enLq_7Fg@mail.gmail.com>
2025-07-02  4:02 ` [PATCH] net/sched: sch_qfq: Fix null-deref in agg_dequeue Xiang Mei
2025-07-02  5:40   ` Greg KH
2025-07-02  7:18     ` Xiang Mei
2025-07-02  7:20       ` Xiang Mei
2025-07-02  7:32       ` Greg KH
2025-07-02  8:30         ` [PATCH v2] " Xiang Mei
2025-07-04  4:45           ` Cong Wang
2025-07-05 21:21             ` [PATCH v3] " Xiang Mei
2025-07-06  3:07               ` Cong Wang [this message]
2025-07-10  9:20               ` patchwork-bot+netdevbpf
2025-07-05 21:24             ` [PATCH v2] " Xiang Mei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aGnodC+JgY8wI9xc@pop-os.localdomain \
    --to=xiyou.wangcong@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --cc=security@kernel.org \
    --cc=xmei5@asu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).