[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJ+HfNhGWA2TNPcrsFUKT7V=_68z4r4e0AaUQxbppn0S40rtsw@mail.gmail.com>
Date: Thu, 24 Feb 2022 14:39:15 +0100
From: Björn Töpel <bjorn.topel@...il.com>
To: Magnus Karlsson <magnus.karlsson@...il.com>
Cc: "Karlsson, Magnus" <magnus.karlsson@...el.com>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Netdev <netdev@...r.kernel.org>,
"Fijalkowski, Maciej" <maciej.fijalkowski@...el.com>,
Jonathan Lemon <jonathan.lemon@...il.com>,
bpf <bpf@...r.kernel.org>, Elza Mathew <elza.mathew@...el.com>
Subject: Re: [PATCH bpf] xsk: fix race at socket teardown
On Tue, 22 Feb 2022 at 10:44, Magnus Karlsson <magnus.karlsson@...il.com> wrote:
>
> From: Magnus Karlsson <magnus.karlsson@...el.com>
>
> Fix a race in the xsk socket teardown code that can lead to a null
> pointer dereference splat. The current xsk unbind code in
> xsk_unbind_dev() starts by setting xs->state to XSK_UNBOUND, sets
> xs->dev to NULL and then waits for any NAPI processing to terminate
> using synchronize_net(). After that, the release code starts to tear
> down the socket state and free allocated memory.
>
[...]
>
> Fixes: 42fddcc7c64b ("xsk: use state member for socket synchronization")
> Reported-by: Elza Mathew <elza.mathew@...el.com>
> Signed-off-by: Magnus Karlsson <magnus.karlsson@...el.com>
Thanks for fixing this!
Acked-by: Björn Töpel <bjorn@...nel.org>
Powered by blists - more mailing lists