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 v1] net/sched: sch_qfq: Fix race condition on qfq_aggregate
Date: Mon, 7 Jul 2025 11:03:50 -0700 [thread overview]
Message-ID: <aGwMBj5BBRuITOlA@pop-os.localdomain> (raw)
In-Reply-To: <20250705223958.4079242-1-xmei5@asu.edu>
On Sat, Jul 05, 2025 at 03:39:58PM -0700, Xiang Mei wrote:
> A race condition can occur when 'agg' is modified in qfq_change_agg
> (called during qfq_enqueue) while other threads access it
> concurrently. For example, qfq_dump_class may trigger a NULL
> dereference, and qfq_delete_class may cause a use-after-free.
>
> This patch addresses the issue by:
>
> 1. Moved qfq_destroy_class into the critical section.
>
> 2. Added sch_tree_lock protection to qfq_dump_class and
> qfq_dump_class_stats.
>
> Signed-off-by: Xiang Mei <xmei5@asu.edu>
Although holding sch_tree_lock() for control path is generally not
elegant, this is clearly not your fault, the current code is already so.
Converting to RCU requires more efforts, so it should be deferred to
long term (net-next).
So as a bug fix, this patch is okay.
Reviewed-by: Cong Wang <xiyou.wangcong@gmail.com>
(I assume you tested it with all tdc selftests.)
Thanks!
next prev parent reply other threads:[~2025-07-07 18:03 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAPpSM+SKOj9U8g_QsGp8M45dtEwvX4B_xdd7C0mP9pYu1b4mzA@mail.gmail.com>
2025-06-29 14:28 ` sch_qfq: race conditon on qfq_aggregate (net/sched/sch_qfq.c) Jamal Hadi Salim
2025-06-30 3:11 ` Xiang Mei
2025-06-30 11:36 ` Jamal Hadi Salim
2025-06-30 18:49 ` Xiang Mei
2025-06-30 23:09 ` Cong Wang
2025-07-01 2:52 ` Xiang Mei
2025-07-02 19:41 ` Xiang Mei
2025-07-04 4:55 ` Cong Wang
2025-07-05 22:39 ` [PATCH v1] net/sched: sch_qfq: Fix race condition on qfq_aggregate Xiang Mei
2025-07-05 22:49 ` Xiang Mei
2025-07-07 18:05 ` Cong Wang
2025-07-07 17:58 ` Jakub Kicinski
2025-07-07 23:42 ` Xiang Mei
2025-07-08 0:20 ` Jakub Kicinski
2025-07-07 18:03 ` Cong Wang [this message]
2025-07-08 0:05 ` Xiang Mei
2025-07-08 3:18 ` Willy Tarreau
2025-07-09 18:08 ` Xiang Mei
2025-07-09 18:06 ` [PATCH v2] " Xiang Mei
2025-07-09 20:19 ` Jakub Kicinski
2025-07-09 21:41 ` Xiang Mei
2025-07-09 21:54 ` Jakub Kicinski
2025-07-10 10:06 ` Xiang Mei
2025-07-10 21:18 ` Cong Wang
2025-07-10 22:45 ` Xiang Mei
2025-07-01 14:02 ` sch_qfq: race conditon on qfq_aggregate (net/sched/sch_qfq.c) Jamal Hadi Salim
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=aGwMBj5BBRuITOlA@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).