From: Michal Luczaj <mhal@rbox.co>
To: Stefano Garzarella <sgarzare@redhat.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
Bobby Eshleman <bobby.eshleman@bytedance.com>,
"Michael S. Tsirkin" <mst@redhat.com>
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org
Subject: Re: [PATCH net] vsock/bpf: Handle EINTR connect() racing against sockmap update
Date: Mon, 10 Mar 2025 00:42:28 +0100 [thread overview]
Message-ID: <be935429-2125-4fea-844b-abce83f7324e@rbox.co> (raw)
In-Reply-To: <20250307-vsock-trans-signal-race-v1-1-3aca3f771fbd@rbox.co>
On 3/7/25 10:27, Michal Luczaj wrote:
> Signal delivered during connect() may result in a disconnect of an already
> TCP_ESTABLISHED socket. Problem is that such established socket might have
> been placed in a sockmap before the connection was closed. We end up with a
> SS_UNCONNECTED vsock in a sockmap. And this, combined with the ability to
> reassign (unconnected) vsock's transport to NULL, breaks the sockmap
> contract. As manifested by WARN_ON_ONCE.
>
> Ensure the socket does not stay in sockmap.
>
> WARNING: CPU: 10 PID: 1310 at net/vmw_vsock/vsock_bpf.c:90 vsock_bpf_recvmsg+0xb4b/0xdf0
> CPU: 10 UID: 0 PID: 1310 Comm: a.out Tainted: G W 6.14.0-rc4+
> sock_recvmsg+0x1b2/0x220
> __sys_recvfrom+0x190/0x270
> __x64_sys_recvfrom+0xdc/0x1b0
> do_syscall_64+0x93/0x1b0
> entry_SYSCALL_64_after_hwframe+0x76/0x7e
>
> Fixes: 634f1a7110b4 ("vsock: support sockmap")
> Signed-off-by: Michal Luczaj <mhal@rbox.co>
This fix is insufficient; warning can be triggered another way. Apologies.
maintainer-netdev.rst says author can do that, so:
pw-bot: cr
next prev parent reply other threads:[~2025-03-09 23:43 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-07 9:27 [PATCH net] vsock/bpf: Handle EINTR connect() racing against sockmap update Michal Luczaj
2025-03-07 9:58 ` Michal Luczaj
2025-03-07 14:35 ` Stefano Garzarella
2025-03-07 16:01 ` Michal Luczaj
2025-03-10 14:52 ` Stefano Garzarella
2025-03-11 13:49 ` Luigi Leonardi
2025-03-14 15:22 ` Michal Luczaj
2025-03-18 8:42 ` Luigi Leonardi
2025-03-11 15:56 ` John Fastabend
2025-03-07 14:33 ` Stefano Garzarella
2025-03-07 16:00 ` Michal Luczaj
2025-03-10 14:57 ` Stefano Garzarella
2025-03-09 23:42 ` Michal Luczaj [this message]
2025-03-10 15:00 ` Stefano Garzarella
2025-03-11 15:38 ` John Fastabend
2025-03-11 16:23 ` John Fastabend
2025-03-14 15:29 ` Michal Luczaj
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=be935429-2125-4fea-844b-abce83f7324e@rbox.co \
--to=mhal@rbox.co \
--cc=bobby.eshleman@bytedance.com \
--cc=bpf@vger.kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--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).