Thread (14 messages) flat view 14 messages, 3 authors, 2026-03-05

Re: [PATCH bpf v2 3/4] bpf, sockmap: Adapt for the af_unix-specific lock

From: Michal Luczaj <hidden>
Date: 2026-02-08 17:14:45
Also in: bpf, linux-kselftest, lkml

On 2/7/26 23:00, Kuniyuki Iwashima wrote:
On Sat, Feb 7, 2026 at 6:35 AM Michal Luczaj [off-list ref] wrote:
quoted
This patch also happens to fix a deadlock that may occur when
bpf_iter_unix_seq_show()'s lock_sock_fast() takes the fast path and the
iter prog attempts to update a sockmap. Which ends up spinning at
sock_map_update_elem()'s bh_lock_sock():
Hmm.. this seems to be a more general problem for
bpf iter vs sockmap.  bpf_iter_{tcp,udp}_seq_show() also
hold lock_sock(),  where this patch's solution does not help.
We need to resolve this regardless of socket family.
I don't see any deadlocks there. Note that I've mentioned lock_sock_fast()
fast path was a problem, not lock_sock().
Also, I feel lock_sock() should be outside of unix_state_lock()
since the former is usually sleepable.  If we used such locking
order in the future, it would trigger ABBA deadlock and we would
have to revisit this problem.
Do I understand correctly you're suggesting taking lock_sock() for af_unix
just as well?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help