Netdev List
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Tristan Madani <tristmd@gmail.com>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>,
	Jiri Pirko <jiri@resnulli.us>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	Christian Brauner <brauner@kernel.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org,
	Tristan Madani <tristan@talencesecurity.com>
Subject: Re: [PATCH net] net/sched: cls_flow: pin file with get_file_rcu before reading f_cred
Date: Sun, 15 Nov 2026 11:08:26 -0800	[thread overview]
Message-ID: <20261115110826.502858e7@kernel.org> (raw)
In-Reply-To: <20261111153106.580776-1-tristmd@gmail.com>

On Wed, 11 Nov 2026 15:31:06 +0000 Tristan Madani wrote:
> flow_get_skuid() and flow_get_skgid() read sk->sk_socket->file->f_cred
> without holding a reference to the file. Since the file slab uses
> SLAB_TYPESAFE_BY_RCU, a concurrent close() may free and recycle the file
> object, causing stale credential data to be read through f_cred.

Missing annotations. Please also make sure you include the answer to
the questions from the bug discovery bot in the commit message of v2.
Otherwise it will ask you again.

net/sched/cls_flow.c:217:32: warning: incorrect type in argument 1 (different address spaces)
net/sched/cls_flow.c:217:32:    expected struct file [noderef] __rcu **f
net/sched/cls_flow.c:217:32:    got struct file **
net/sched/cls_flow.c:235:32: warning: incorrect type in argument 1 (different address spaces)
net/sched/cls_flow.c:235:32:    expected struct file [noderef] __rcu **f
net/sched/cls_flow.c:235:32:    got struct file **
-- 
pw-bot: cr

      parent reply	other threads:[~2026-11-15 19:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11 15:31 [PATCH net] net/sched: cls_flow: pin file with get_file_rcu before reading f_cred Tristan Madani
2026-11-11 15:37 ` netdev-bot+sinfo
2026-11-13 22:09   ` Tristan Madani
2026-11-15 19:08 ` Jakub Kicinski [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=20261115110826.502858e7@kernel.org \
    --to=kuba@kernel.org \
    --cc=brauner@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=tristan@talencesecurity.com \
    --cc=tristmd@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