[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8c06807aff1be5f95c1321221f9616d692c9fa4e.camel@redhat.com>
Date: Mon, 19 Feb 2024 19:07:36 +0100
From: Paolo Abeni <pabeni@...hat.com>
To: Eric Dumazet <edumazet@...gle.com>, "David S . Miller"
<davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>
Cc: netdev@...r.kernel.org, eric.dumazet@...il.com, Willem de Bruijn
<willemdebruijn.kernel@...il.com>, Daan De Meyer
<daan.j.demeyer@...il.com>, Kuniyuki Iwashima <kuniyu@...zon.com>, Martin
KaFai Lau <martin.lau@...nel.org>, David Ahern <dsahern@...nel.org>
Subject: Re: [PATCH net] net: implement lockless setsockopt(SO_PEEK_OFF)
On Mon, 2024-02-19 at 14:12 +0000, Eric Dumazet wrote:
> syzbot reported a lockdep violation [1] involving af_unix
> support of SO_PEEK_OFF.
>
> Since SO_PEEK_OFF is inherently not thread safe (it uses a per-socket
> sk_peek_off field), there is really no point to enforce a pointless
> thread safety in the kernel.
>
> After this patch :
>
> - setsockopt(SO_PEEK_OFF) no longer acquires the socket lock.
>
> - skb_consume_udp() no longer has to acquire the socket lock.
>
> - af_unix no longer needs a special version of sk_set_peek_off(),
> because it does not lock u->iolock anymore.
>
> As a followup, we could replace prot->set_peek_off to be a boolean
> and avoid an indirect call, since we always use sk_set_peek_off().
Only related to that mentioned possible follow-up: I'm trying to
benchmarking the UDP change mentioned here:
https://lore.kernel.org/netdev/725a92b4813242549f2316e6682d3312b5e658d8.camel@redhat.com/
and that it will require an udp specific set_peek_off() variant.
The indirect call in the control path should not be too bad, right?
Thanks,
Paolo
Powered by blists - more mailing lists