[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6a63e1f1-4130-4862-a543-1715ca45ee6d@linux.dev>
Date: Fri, 10 Jan 2025 11:13:44 -0800
From: Martin KaFai Lau <martin.lau@...ux.dev>
To: Eric Dumazet <edumazet@...gle.com>
Cc: Jakub Kicinski <kuba@...nel.org>, "David S . Miller"
<davem@...emloft.net>, Paolo Abeni <pabeni@...hat.com>,
netdev@...r.kernel.org, Simon Horman <horms@...nel.org>,
eric.dumazet@...il.com,
syzbot+b3e02953598f447d4d2a@...kaller.appspotmail.com,
Martin KaFai Lau <kafai@...com>
Subject: Re: [PATCH net] net: restrict SO_REUSEPORT to TCP, UDP and SCTP
sockets
On 12/31/24 4:44 AM, Eric Dumazet wrote:
> On Tue, Dec 31, 2024 at 1:07 AM Jakub Kicinski <kuba@...nel.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;
> }
Powered by blists - more mailing lists