tcp_bpf: propagate error code in tcp_bpf_sendmsg()
Subsystems (5)
PATCH v2 1/1 tcp_bpf: propagate error code in tcp_bpf_sendmsg()
In tcp_bpf_sendmsg(), the value returned by sk_msg_memcopy_from_iter() is checked for error but not propagated to 'out_err' label, so error handling may not work as expected. Fix this by assigning error value to 'err', thus making sure that error won't be silently ignored.
---
v2: more descriptive commit message
--- net/ipv4/tcp_bpf.c | 1 + 1 file changed, 1 insertion(+)
net/ipv4/tcp_bpf.c +1 -0
@@ -581,6 +581,7 @@ static int tcp_bpf_sendmsg(struct sock *sk, struct msghdr *msg, size_t size) copy);if (ret <0 ) {sk_msg_trim (sk, msg_tx, osize); + err = ret; goto out_err; }
Signature · 1 line
2.56.0
[email protected]
AI reviewThis is an automated message. This series looks like a fix, but its commit messages seem to be missing some information:
Hi!
This is an automated message. This series looks like a fix, but its commit messages seem to be missing some information:
- Whether the issue was actually triggered, or is only theoretical (e.g. found by code inspection). If it was triggered please include the symptoms, like the stack trace or error messages.
Please do not repost the series just to address the above. Instead, reply to this email with the missing information, so that reviewers can take it into account. If the series needs another revision for other reasons, please include the information in the commit messages then.
The evaluation is done by an LLM so it may be wrong, if you think that is the case please reply and explain.
Quoted 8 lines · Dmitry Antipov
In
tcp_bpf_sendmsg(), the value returned bysk_msg_memcopy_from_iter()is checked for error but not propagated to 'out_err' label, so error handling may not work as expected. Fix this by assigning error value to 'err', thus making sure that error won't be silently ignored.Reported-by Sashiko <[email protected]>Fixes 5153a75ef34b ("tcp_bpf: Fix copied value in tcp_bpf_sendmsg")Signed-off-by Dmitry Antipov <[email protected]>
Quoted 9 lines · Dmitry Antipov
In
tcp_bpf_sendmsg(), the value returned bysk_msg_memcopy_from_iter()is checked for error but not propagated to 'out_err' label, so error handling may not work as expected. Fix this by assigning error value to 'err', thus making sure that error won't be silently ignored.Reported-by Sashiko <[email protected]>Fixes 5153a75ef34b ("tcp_bpf: Fix copied value in tcp_bpf_sendmsg")Signed-off-by Dmitry Antipov <[email protected]>
Quoted 8 lines · Jason Xing
Quoted 6 lines · Dmitry Antipov
In
tcp_bpf_sendmsg(), the value returned bysk_msg_memcopy_from_iter()is checked for error but not propagated to 'out_err' label, so error handling may not work as expected. Fix this by assigning error value to 'err', thus making sure that error won't be silently ignored.
Quoted 5 lines
Quoted 3 lines
Reported-by Sashiko <[email protected]>Fixes 5153a75ef34b ("tcp_bpf: Fix copied value in tcp_bpf_sendmsg")Signed-off-by Dmitry Antipov <[email protected]>Reviewed-by Jason Xing <[email protected]>
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 10 lines · On Mon, 19 Oct 2026 11:22:14 +0300 you wrote:
In
tcp_bpf_sendmsg(), the value returned bysk_msg_memcopy_from_iter()is checked for error but not propagated to 'out_err' label, so error handling may not work as expected. Fix this by assigning error value to 'err', thus making sure that error won't be silently ignored.Reported-by Sashiko <[email protected]>Fixes 5153a75ef34b ("tcp_bpf: Fix copied value in tcp_bpf_sendmsg")Signed-off-by Dmitry Antipov <[email protected]>[...]
Here is the summary with links:
- [v2] tcp_bpf: propagate error code in tcp_bpf_sendmsg()
https://git.kernel.org/netdev/net/c/82e31923c055
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html