public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Jakub Kicinski <kuba@kernel.org>, jiri@resnulli.us
Cc: Ren Wei <n05ec@lzu.edu.cn>,
	netdev@vger.kernel.org, jhs@mojatatu.com, davem@davemloft.net,
	edumazet@google.com, horms@kernel.org, sbrivio@redhat.com,
	vladbu@mellanox.com, yuantan098@gmail.com, yifanwucs@gmail.com,
	tomapufckgml@gmail.com, bird@lzu.edu.cn, kanolyc@gmail.com,
	z1652074432@gmail.com
Subject: Re: [PATCH net v2 1/1] net/sched: cls_flower: avoid stale mask references after delete
Date: Tue, 28 Apr 2026 12:11:00 +0200	[thread overview]
Message-ID: <03a1d7f1-d40f-4e2f-b61f-0d82b0dcbf05@redhat.com> (raw)
In-Reply-To: <20260423115129.6d8cbd15@kernel.org>

On 4/23/26 8:51 PM, Jakub Kicinski wrote:
> On Wed, 22 Apr 2026 00:03:02 +0800 Ren Wei wrote:
>> From: Yuhang Zheng <z1652074432@gmail.com>
>>
>> cls_flower keeps filter and mask state separately. After a filter is
>> removed or replaced, some paths can still need the mask data associated
>> with that filter.
>>
>> Cache the mask key and dissector in struct cls_fl_filter when the mask
>> is assigned, and use the cached copies in dump and offload paths. This
>> avoids depending on the external mask object's lifetime after delete or
>> replace.
>>
>> Fixes: 92149190067d ("net: sched: flower: set unlocked flag for flower proto ops")
>> Cc: stable@kernel.org
>> Reported-by: Yuan Tan <yuantan098@gmail.com>
>> Reported-by: Yifan Wu <yifanwucs@gmail.com>
>> Reported-by: Juefei Pu <tomapufckgml@gmail.com>
>> Reported-by: Xin Liu <bird@lzu.edu.cn>
>> Tested-by: Yucheng Lu <kanolyc@gmail.com>
>> Signed-off-by: Yuhang Zheng <z1652074432@gmail.com>
>> Signed-off-by: Ren Wei <n05ec@lzu.edu.cn>
> 
> Jiri, do you have an opinion? Feels slightly wasteful (as sashiko points
> out), IDK if there's a cleaner fix.

I agree we should try hard to avoid the considerable struct
cls_fl_filter size increase.

Would be possible to move the fl_mask_put() into __fl_put, after the
rfcount decrement?!?

Or possibly would be less invasive to set the fd->mask to NULL in
__fl_delete() under the tp->lock, and explicitly check for NULL ptr in
before access (AFAICS, each access is under tp->lock).

/P


      reply	other threads:[~2026-04-28 10:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-21 16:03 [PATCH net v2 1/1] net/sched: cls_flower: avoid stale mask references after delete Ren Wei
2026-04-23 18:51 ` Jakub Kicinski
2026-04-28 10:11   ` Paolo Abeni [this message]

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=03a1d7f1-d40f-4e2f-b61f-0d82b0dcbf05@redhat.com \
    --to=pabeni@redhat.com \
    --cc=bird@lzu.edu.cn \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=kanolyc@gmail.com \
    --cc=kuba@kernel.org \
    --cc=n05ec@lzu.edu.cn \
    --cc=netdev@vger.kernel.org \
    --cc=sbrivio@redhat.com \
    --cc=tomapufckgml@gmail.com \
    --cc=vladbu@mellanox.com \
    --cc=yifanwucs@gmail.com \
    --cc=yuantan098@gmail.com \
    --cc=z1652074432@gmail.com \
    /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