netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Stefano Garzarella <sgarzare@redhat.com>
Cc: Norbert Slusarek <nslusarek@gmx.net>,
	alex.popov@linux.com, eric.dumazet@gmail.com,
	netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH] net/vmw_vsock: fix NULL pointer dereference
Date: Sat, 6 Feb 2021 16:57:00 -0800	[thread overview]
Message-ID: <20210206165700.23c5ae36@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> (raw)
In-Reply-To: <20210205171335.hpzoysoynko4bkhe@steredhat>

On Fri, 5 Feb 2021 18:13:35 +0100 Stefano Garzarella wrote:
> On Fri, Feb 05, 2021 at 03:25:17PM +0100, Norbert Slusarek wrote:
> >From: Norbert Slusarek <nslusarek@gmx.net>
> >Date: Fri, 5 Feb 2021 13:12:06 +0100
> >Subject: [PATCH] net/vmw_vsock: fix NULL pointer dereference
> >
> >In vsock_stream_connect(), a thread will enter schedule_timeout().
> >While being scheduled out, another thread can enter vsock_stream_connect()
> >as well and set vsk->transport to NULL. In case a signal was sent, the
> >first thread can leave schedule_timeout() and vsock_transport_cancel_pkt()
> >will be called right after. Inside vsock_transport_cancel_pkt(), a null
> >dereference will happen on transport->cancel_pkt.
> >
> >Fixes: c0cfa2d8a788 ("vsock: add multi-transports support")
> >Reported-by: Norbert Slusarek <nslusarek@gmx.net>
> >Signed-off-by: Norbert Slusarek <nslusarek@gmx.net>
> >---
> > net/vmw_vsock/af_vsock.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> >diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
> >index 6894f21dc147..cb81cfb47a78 100644
> >--- a/net/vmw_vsock/af_vsock.c
> >+++ b/net/vmw_vsock/af_vsock.c
> >@@ -1233,7 +1233,7 @@ static int vsock_transport_cancel_pkt(struct vsock_sock *vsk)
> > {
> > 	const struct vsock_transport *transport = vsk->transport;
> >
> >-	if (!transport->cancel_pkt)
> >+	if (!transport || !transport->cancel_pkt)
> > 		return -EOPNOTSUPP;
> >
> > 	return transport->cancel_pkt(vsk);
> >--
> >2.30.0
> >  
> 
> I can't see this patch on https://patchwork.kernel.org/project/netdevbpf/list/
> 
> Maybe because you forgot to CC the netdev maintainers.
> Please next time use scripts/get_maintainer.pl
> 
> Anyway the patch LGTM, so
> 
> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>

Applied, thanks!

  reply	other threads:[~2021-02-07  0:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-05 14:25 [PATCH] net/vmw_vsock: fix NULL pointer dereference Norbert Slusarek
2021-02-05 17:13 ` Stefano Garzarella
2021-02-07  0:57   ` Jakub Kicinski [this message]
2021-02-05 15:02 Norbert Slusarek

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=20210206165700.23c5ae36@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com \
    --to=kuba@kernel.org \
    --cc=alex.popov@linux.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nslusarek@gmx.net \
    --cc=sgarzare@redhat.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;
as well as URLs for NNTP newsgroup(s).