Re: [PATCH net-next] net: bpf: Use sockopt_lock_sock() in ip_sock_set_tos()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 27, 2023 at 8:24 PM Yonghong Song <yonghong.song@xxxxxxxxx> wrote:
>
> With latest sync from net-next tree, bpf-next has a bpf selftest failure:
>   [root@arch-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@xxxxxxxxxx>
> Suggested-by: Martin KaFai Lau <martin.lau@xxxxxxxxxx>
> Signed-off-by: Yonghong Song <yonghong.song@xxxxxxxxx>
> ---

SGTM, thanks.

Reviewed-by: Eric Dumazet <edumazet@xxxxxxxxxx>





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux