Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by Sechang Lim
Mon, 30 Nov 2026 11:34
[PATCH bpf] bpf, sockmap: Stop the sk_msg verdict loop on a fatal signal
Author: Sechang Lim
Date: Mon, 30 Nov 2026 11:34
Date: Mon, 30 Nov 2026 11:34
38 lines
11849 bytes
11849 bytes
tcp_bpf_send_verdict() loops as long as msg has data left, sending at
most apply_bytes per round and running the SK_MSG program again when
apply_bytes is used up. A program that pushes at least as many bytes
as it applies, e.g. an 8-byte header with apply_bytes 8, keeps msg from
ever draining. With a redirect to a socket that keeps reading, send()
never returns and the task ignores SIGKILL.
Free the rest of msg and return -EINTR when a fatal signal is pending,
as the push error path does.
Fixes: 6fff607e2f14 ("bpf: sk_msg program helper bpf_msg_push_data")
Signed-off-by: Sechang Lim <rhkrqnwk98@gmail.com>
---
net/ipv4/tcp_bpf.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/net/ipv4/tcp_bpf.c b/net/ipv4/tcp_bpf.c
index 788ce08eef4d..f62c3238c300 100644
--- a/net/ipv4/tcp_bpf.c
+++ b/net/ipv4/tcp_bpf.c
@@ -580,8 +580,13 @@ static int tcp_bpf_send_verdict(struct sock *sk, struct sk_psock *psock,
}
if (msg &&
msg->sg.data[msg->sg.start].page_link &&
- msg->sg.data[msg->sg.start].length)
+ msg->sg.data[msg->sg.start].length) {
+ if (fatal_signal_pending(current)) {
+ *copied -= sk_msg_free(sk, msg);
+ return -EINTR;
+ }
goto more_data;
+ }
}
return ret;
}
--
2.56.1
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads