From: Martin KaFai Lau <martin.lau@linux.dev>
To: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>,
"David S . Miller" <davem@davemloft.net>,
Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, Simon Horman <horms@kernel.org>,
eric.dumazet@gmail.com,
syzbot+b3e02953598f447d4d2a@syzkaller.appspotmail.com,
Martin KaFai Lau <kafai@fb.com>
Subject: Re: [PATCH net] net: restrict SO_REUSEPORT to TCP, UDP and SCTP sockets
Date: Fri, 10 Jan 2025 11:13:44 -0800 [thread overview]
Message-ID: <6a63e1f1-4130-4862-a543-1715ca45ee6d@linux.dev> (raw)
In-Reply-To: <CANn89iJzjq9w-Z8GJaY1=KDLku00aweoZTB4_XHzHe=Cp7xy6w@mail.gmail.com>
On 12/31/24 4:44 AM, Eric Dumazet wrote:
> On Tue, Dec 31, 2024 at 1:07 AM Jakub Kicinski <kuba@kernel.org> wrote:
>>
>> On Mon, 30 Dec 2024 19:34:30 +0000 Eric Dumazet wrote:
>>> After blamed commit, crypto sockets could accidentally be destroyed
>>> from RCU callback, as spotted by zyzbot [1].
>>>
>>> Trying to acquire a mutex in RCU callback is not allowed.
>>>
>>> Restrict SO_REUSEPORT socket option to TCP, UDP and SCTP sockets.
>>
>> Looks like fcnal_test.sh and reuseport_addr_any.sh are failing
>> after this patch, we need to adjust their respective binaries.
>> I'll hide this patch from patchwork, even tho it's probably right..
>
> It seems we should support raw sockets, they already use SOCK_RCU_FREE anyway.
>
> Although sk_reuseport_attach_bpf() has the following checks :
>
> if ((sk->sk_type != SOCK_STREAM &&
> sk->sk_type != SOCK_DGRAM) ||
> (sk->sk_protocol != IPPROTO_UDP &&
> sk->sk_protocol != IPPROTO_TCP) ||
> (sk->sk_family != AF_INET &&
> sk->sk_family != AF_INET6)) {
I think this should be mostly aligned with what is supported in the bpf
reuseport_array and sock_map. This can be changed if other sock supported is
added to the bpf map.
> err = -ENOTSUPP;
> goto err_prog_put;
> }
next prev parent reply other threads:[~2025-01-10 19:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-30 19:34 [PATCH net] net: restrict SO_REUSEPORT to TCP, UDP and SCTP sockets Eric Dumazet
2024-12-31 0:07 ` Jakub Kicinski
2024-12-31 12:44 ` Eric Dumazet
2025-01-10 19:13 ` Martin KaFai Lau [this message]
2024-12-31 18:33 ` David Laight
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=6a63e1f1-4130-4862-a543-1715ca45ee6d@linux.dev \
--to=martin.lau@linux.dev \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eric.dumazet@gmail.com \
--cc=horms@kernel.org \
--cc=kafai@fb.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=syzbot+b3e02953598f447d4d2a@syzkaller.appspotmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.