RE: [PATCH bpf-next] bpf, sockmap: fix deadlocks in the sockhash and sockmap

From: John Fastabend
Date: Thu Apr 06 2023 - 17:13:30 EST


Xin Liu wrote:
> When huang uses sched_switch tracepoint, the tracepoint
> does only one thing in the mounted ebpf program, which
> deletes the fixed elements in sockhash ([0])
>
> It seems that elements in sockhash are rarely actively
> deleted by users or ebpf program. Therefore, we do not
> pay much attention to their deletion. Compared with hash
> maps, sockhash only provides spin_lock_bh protection.
> This causes it to appear to have self-locking behavior
> in the interrupt context.
>
> [0]:https://lore.kernel.org/all/CABcoxUayum5oOqFMMqAeWuS8+EzojquSOSyDA3J_2omY=2EeAg@xxxxxxxxxxxxxx/
>
> Reported-by: Hsin-Wei Hung <hsinweih@xxxxxxx>
> Fixes: 604326b41a6f ("bpf, sockmap: convert to generic sk_msg interface")
> Signed-off-by: Xin Liu <liuxin350@xxxxxxxxxx>

Yeah even if we delete entries we do it from a sockops. Thanks for the
fix.

Acked-by: John Fastabend <john.fastabend@xxxxxxxxx>