public inbox for virtualization@lists.linux-foundation.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Stefano Garzarella <sgarzare@redhat.com>
Cc: virtualization@lists.linux.dev, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, stable <stable@kernel.org>
Subject: Re: [PATCH net] vsock: Use container_of() to get net namespace in sysctl handlers
Date: Wed, 25 Feb 2026 06:33:45 -0800	[thread overview]
Message-ID: <2026022550-expire-divinity-e12b@gregkh> (raw)
In-Reply-To: <aZ1oTufA5JkTBl35@sgarzare-redhat>

On Tue, Feb 24, 2026 at 10:54:58AM +0100, Stefano Garzarella wrote:
> On Mon, Feb 23, 2026 at 06:32:18PM +0100, Greg Kroah-Hartman wrote:
> > current->nsproxy is should not be accessed directly as syzbot has found
>                   ^
> nit: "is" can be removed
> 
> > that it could be NULL at times, causing crashes.  Fix up the af_vsock
> > sysctl handlers to use container_of() to deal with the current net
> > namespace instead of attempting to rely on current.
> > 
> > This is the same type of change done in commit 7f5611cbc487 ("rds:
> > sysctl: rds_tcp_{rcv,snd}buf: avoid using current->nsproxy")
> > 
> > Cc: Stefano Garzarella <sgarzare@redhat.com>
> > Cc: stable <stable@kernel.org>
> 
> I'm not sure this is stable material since these changes landed in the
> latest merge window (v7.0-rc1), but yeah, you know better than me, so there
> could be a reason.
> 
> If needed, maybe we can also add:
> 
> Fixes: eafb64f40ca4 ("vsock: add netns to vsock core")

Ah, I missed that this was a "new" thing, you are right, cc: stable
wasn't needed, and the fixes: tag is good to have.  I don't normally add
those as it's up to me to do the backports and I can figure it out on my
own when they hit Linus's tree :)

> > Assisted-by: gkh_clanker_2000
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > ---
> > 
> > Note, this is compile-tested only.  Some of my scripts found this when
> > looking for places that are missing fixes that were applied to other
> > parts of the kernel.  I think the af_vsock code uses namespaces, but as
> > I don't know the network stack at all I figured I would let you all
> > review it to tell me how wrong I got this change and all is fine with
> > the original code.
> 
> Thanks! LGTM and tests are fine!
> 
> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>

Great, thanks for testing and the review!

greg k-h

  reply	other threads:[~2026-02-25 14:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-23 17:32 [PATCH net] vsock: Use container_of() to get net namespace in sysctl handlers Greg Kroah-Hartman
2026-02-23 18:54 ` Bobby Eshleman
2026-02-24  9:54 ` Stefano Garzarella
2026-02-25 14:33   ` Greg Kroah-Hartman [this message]
2026-02-26  3:10 ` patchwork-bot+netdevbpf

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=2026022550-expire-divinity-e12b@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sgarzare@redhat.com \
    --cc=stable@kernel.org \
    --cc=virtualization@lists.linux.dev \
    /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