From: Stephen Hemminger <stephen@networkplumber.org>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: netdev@vger.kernel.org, Xiang Mei <xmei5@asu.edu>
Subject: Re: [Patch net v6 1/8] net_sched: Check the return value of qfq_choose_next_agg()
Date: Tue, 30 Dec 2025 09:24:15 -0800 [thread overview]
Message-ID: <20251230092415.077d176c@phoenix.local> (raw)
In-Reply-To: <20251227194135.1111972-2-xiyou.wangcong@gmail.com>
On Sat, 27 Dec 2025 11:41:28 -0800
Cong Wang <xiyou.wangcong@gmail.com> wrote:
> qfq_choose_next_agg() could return NULL so its return value should be
> properly checked unless NULL is acceptable.
>
> There are two cases we need to deal with:
>
> 1) q->in_serv_agg, which is okay with NULL since it is either checked or
> just compared with other pointer without dereferencing. In fact, it
> is even intentionally set to NULL in one of the cases.
>
> 2) in_serv_agg, which is a temporary local variable, which is not okay
> with NULL, since it is dereferenced immediately, hence must be checked.
>
> This fix corrects one of the 2nd cases, and leaving the 1st case as they are.
>
> Although this bug is triggered with the netem duplicate change, the root
> cause is still within qfq qdisc.
>
> Fixes: 462dbc9101ac ("pkt_sched: QFQ Plus: fair-queueing service at DRR cost")
> Reviewed-by: Xiang Mei <xmei5@asu.edu>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Looks correct, if you make a new version might want to add a comment.
If you really want to get picky the rest of the code in QFQ compares
with NULL. i.e (in_serv_agg != NULL)
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
next prev parent reply other threads:[~2025-12-30 17:24 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-27 19:41 [Patch net v6 0/8] netem: Fix skb duplication logic and prevent infinite loops Cong Wang
2025-12-27 19:41 ` [Patch net v6 1/8] net_sched: Check the return value of qfq_choose_next_agg() Cong Wang
2025-12-30 17:24 ` Stephen Hemminger [this message]
2025-12-27 19:41 ` [Patch net v6 2/8] Revert "net/sched: Restrict conditions for adding duplicating netems to qdisc tree" Cong Wang
2025-12-27 19:41 ` [Patch net v6 3/8] Revert "selftests/tc-testing: Add tests for restrictions on netem duplication" Cong Wang
2025-12-27 19:41 ` [Patch net v6 4/8] net_sched: Implement the right netem duplication behavior Cong Wang
2025-12-30 17:28 ` Stephen Hemminger
2026-01-04 19:19 ` Jakub Kicinski
2026-01-07 23:33 ` Cong Wang
2026-01-08 2:18 ` Jakub Kicinski
2025-12-27 19:41 ` [Patch net v6 5/8] selftests/tc-testing: Add a nested netem duplicate test Cong Wang
2025-12-27 19:41 ` [Patch net v6 6/8] selftests/tc-testing: Add a test case for piro with netem duplicate Cong Wang
2026-01-04 19:15 ` Jakub Kicinski
2026-01-07 23:34 ` Cong Wang
2025-12-27 19:41 ` [Patch net v6 7/8] selftests/tc-testing: Add a test case for mq " Cong Wang
2025-12-27 19:41 ` [Patch net v6 8/8] selftests/tc-testing: Update test cases " Cong Wang
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=20251230092415.077d176c@phoenix.local \
--to=stephen@networkplumber.org \
--cc=netdev@vger.kernel.org \
--cc=xiyou.wangcong@gmail.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.