[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iJa4gp4MJMVyfR+gqD+RNcYP21YgtP8b0iu0zSQKomHQg@mail.gmail.com>
Date: Fri, 27 Oct 2023 20:42:38 +0200
From: Eric Dumazet <edumazet@...gle.com>
To: Yonghong Song <yonghong.song@...ux.dev>
Cc: bpf@...r.kernel.org, netdev@...r.kernel.org,
Alexei Starovoitov <ast@...nel.org>, Andrii Nakryiko <andrii@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>, kernel-team@...com,
Martin KaFai Lau <martin.lau@...nel.org>
Subject: Re: [PATCH net-next] net: bpf: Use sockopt_lock_sock() in ip_sock_set_tos()
On Fri, Oct 27, 2023 at 8:24 PM Yonghong Song <yonghong.song@...ux.dev> wrote:
>
> With latest sync from net-next tree, bpf-next has a bpf selftest failure:
> [root@...h-fb-vm1 bpf]# ./test_progs -t setget_sockopt
> ...
> [ 76.194349] ============================================
> ...
>
> Both ip_sock_set_tos() and inet_listen() calls lock_sock(sk) which
> caused a dead lock.
>
> To fix the issue, use sockopt_lock_sock() in ip_sock_set_tos()
> instead. sockopt_lock_sock() will avoid lock_sock() if it is in bpf
> context.
>
> Fixes: 878d951c6712 ("inet: lock the socket in ip_sock_set_tos()")
> Cc: Eric Dumazet <edumazet@...gle.com>
> Suggested-by: Martin KaFai Lau <martin.lau@...nel.org>
> Signed-off-by: Yonghong Song <yonghong.song@...ux.dev>
> ---
SGTM, thanks.
Reviewed-by: Eric Dumazet <edumazet@...gle.com>
Powered by blists - more mailing lists