Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Samuel Mendoza-Jonas <samjonas@amazon.com>
Cc: stable@vger.kernel.org, benh@amazon.com,
	Al Viro <viro@zeniv.linux.org.uk>,
	stable@kernel.org, "Michael S . Tsirkin" <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>
Subject: Re: [PATCH 4.14] Fix double fget() in vhost_net_set_backend()
Date: Wed, 7 Jun 2023 20:35:29 +0200	[thread overview]
Message-ID: <2023060713-scoreless-gratitude-2177@gregkh> (raw)
In-Reply-To: <20230606182831.639358-1-samjonas@amazon.com>

On Tue, Jun 06, 2023 at 11:28:31AM -0700, Samuel Mendoza-Jonas wrote:
> From: Al Viro <viro@zeniv.linux.org.uk>
> 
> commit fb4554c2232e44d595920f4d5c66cf8f7d13f9bc upstream.
> 
> Descriptor table is a shared resource; two fget() on the same descriptor
> may return different struct file references.  get_tap_ptr_ring() is
> called after we'd found (and pinned) the socket we'll be using and it
> tries to find the private tun/tap data structures associated with it.
> Redoing the lookup by the same file descriptor we'd used to get the
> socket is racy - we need to same struct file.
> 
> Thanks to Jason for spotting a braino in the original variant of patch -
> I'd missed the use of fd == -1 for disabling backend, and in that case
> we can end up with sock == NULL and sock != oldsock.
> 
> Cc: stable@kernel.org
> Acked-by: Michael S. Tsirkin <mst@redhat.com>
> Signed-off-by: Jason Wang <jasowang@redhat.com>
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

I did not sign off on this patch, where did that come from?

Please be more careful.

thanks,

greg k-h

  reply	other threads:[~2023-06-07 18:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-06 18:28 [PATCH 4.14] Fix double fget() in vhost_net_set_backend() Samuel Mendoza-Jonas
2023-06-07 18:35 ` Greg Kroah-Hartman [this message]
2023-06-07 18:49   ` Samuel Mendoza-Jonas

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=2023060713-scoreless-gratitude-2177@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=benh@amazon.com \
    --cc=jasowang@redhat.com \
    --cc=mst@redhat.com \
    --cc=samjonas@amazon.com \
    --cc=stable@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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