Thread (5 messages) 5 messages, 3 authors, 2d ago

Re: [PATCH bpf 1/2] bpf, sockmap: Stop reporting EPIPE on zero-length skb redirect

flat view

From: Eli Skeggs <hidden>
Date: 2026-10-26 02:25:20
Also in: bpf, linux-kselftest, lkml

On Mon, Oct 26, 2026 at 01:51:43AM +0000, Alexei Starovoitov wrote:
On Sun, Oct 25, 2026 at 04:41 PM Eli Skeggs via B4 Relay [off-list ref] wrote:
quoted
On an ingress redirect, the empty message is still queued as before, but
the target socket no longer reports EPIPE.
That leaves the target broken.
Nothing dequeues the empty sk_msg. __sk_msg_recvmsg() sees
sge->length == 0, returns -EFAULT and leaves it at the head of ingress_msg.
tcp_bpf_recvmsg_parser() finds FIN in is_next_msg_fin(), returns 0 and
does copied_seq++ on a socket that didn't receive any FIN.
So every recv() on the target returns 0 and moves its copied_seq further
past rcv_nxt, and the data redirected from other sockets stays behind
that msg forever.
Thanks, I'd missed that detail of __sk_msg_recvmsg().
Lets skip empty skbs instead. That covers both directions.
The socket's own FIN that goes through the backlog is not queued either,
but SOCK_DONE check in tcp_bpf_recvmsg_parser() returns 0 anyway.
That does sound much cleaner. v2 will skip empty skbs entirely, and I'll
add a corresponding selftest for the ingress pathway.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help