Re: BUG: bpf: task hung in lock_sock_nested during sockmap free

From: Kenneth Lee

Date: Wed Aug 19 2026 - 22:29:44 EST


Hi,

After further analysis, we found that this report is triggered by an
SK_MSG BPF program repeatedly calling bpf_msg_apply_bytes(msg, 1).

For a message of about 557 KiB, this results in approximately 557,000
one-byte verdict and push iterations. The TCP BPF send path keeps the
socket lock while processing these iterations, so deferred
sock_map_free() waits for the same socket lock.

This appears to be a long lock-held processing path triggered by a valid
but very unrealistic msg_apply_bytes(1) workload. We believe this behavior
is benign, but let us know if other behavior is expected.

Thanks,
Kenneth Lee