* [PATCH v2] tcp_bpf: propagate error code in tcp_bpf_sendmsg()
@ 2026-10-19 8:22 Dmitry Antipov
2026-10-19 8:28 ` netdev-bot+sinfo
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Dmitry Antipov @ 2026-10-19 8:22 UTC (permalink / raw)
To: Eric Dumazet, Daniel Borkmann, Jakub Kicinski, Levi Zim
Cc: Denis Yarapov, netdev, bpf, lvc-project, Dmitry Antipov, Sashiko
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.
Reported-by: Sashiko <shodan.ai@mcst.ru>
Fixes: 5153a75ef34b ("tcp_bpf: Fix copied value in tcp_bpf_sendmsg")
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
---
v2: more descriptive commit message
---
net/ipv4/tcp_bpf.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/ipv4/tcp_bpf.c b/net/ipv4/tcp_bpf.c
index 2e234d155b5e..0ce583f68d3b 100644
--- a/net/ipv4/tcp_bpf.c
+++ b/net/ipv4/tcp_bpf.c
@@ -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;
}
--
2.56.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2] tcp_bpf: propagate error code in tcp_bpf_sendmsg()
2026-10-19 8:22 [PATCH v2] tcp_bpf: propagate error code in tcp_bpf_sendmsg() Dmitry Antipov
@ 2026-10-19 8:28 ` netdev-bot+sinfo
2026-10-20 4:44 ` Kuniyuki Iwashima
2026-10-20 6:23 ` Jason Xing
2 siblings, 0 replies; 5+ messages in thread
From: netdev-bot+sinfo @ 2026-10-19 8:28 UTC (permalink / raw)
To: Dmitry Antipov
Cc: Eric Dumazet, Daniel Borkmann, Jakub Kicinski, Levi Zim,
Denis Yarapov, netdev, bpf, lvc-project, Sashiko
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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] tcp_bpf: propagate error code in tcp_bpf_sendmsg()
2026-10-19 8:22 [PATCH v2] tcp_bpf: propagate error code in tcp_bpf_sendmsg() Dmitry Antipov
2026-10-19 8:28 ` netdev-bot+sinfo
@ 2026-10-20 4:44 ` Kuniyuki Iwashima
2026-10-20 6:23 ` Jason Xing
2 siblings, 0 replies; 5+ messages in thread
From: Kuniyuki Iwashima @ 2026-10-20 4:44 UTC (permalink / raw)
To: Dmitry Antipov
Cc: Eric Dumazet, Daniel Borkmann, Jakub Kicinski, Levi Zim,
Denis Yarapov, netdev, bpf, lvc-project, Sashiko
On Mon, 19 Oct 2026 11:22:14 +0300, Dmitry Antipov wrote:
> 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.
>
> Reported-by: Sashiko <shodan.ai@mcst.ru>
> Fixes: 5153a75ef34b ("tcp_bpf: Fix copied value in tcp_bpf_sendmsg")
> Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] tcp_bpf: propagate error code in tcp_bpf_sendmsg()
2026-10-19 8:22 [PATCH v2] tcp_bpf: propagate error code in tcp_bpf_sendmsg() Dmitry Antipov
2026-10-19 8:28 ` netdev-bot+sinfo
2026-10-20 4:44 ` Kuniyuki Iwashima
@ 2026-10-20 6:23 ` Jason Xing
2026-10-20 7:50 ` Eric Dumazet
2 siblings, 1 reply; 5+ messages in thread
From: Jason Xing @ 2026-10-20 6:23 UTC (permalink / raw)
To: Dmitry Antipov
Cc: Eric Dumazet, Daniel Borkmann, Jakub Kicinski, Levi Zim,
Denis Yarapov, netdev, bpf, lvc-project, Sashiko
On Mon, Oct 19, 2026 at 4:27 PM Dmitry Antipov <dmantipov@yandex.ru> wrote:
>
> 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.
>
> Reported-by: Sashiko <shodan.ai@mcst.ru>
> Fixes: 5153a75ef34b ("tcp_bpf: Fix copied value in tcp_bpf_sendmsg")
> Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Reviewed-by: Jason Xing <kerneljasonxing@gmail.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] tcp_bpf: propagate error code in tcp_bpf_sendmsg()
2026-10-20 6:23 ` Jason Xing
@ 2026-10-20 7:50 ` Eric Dumazet
0 siblings, 0 replies; 5+ messages in thread
From: Eric Dumazet @ 2026-10-20 7:50 UTC (permalink / raw)
To: Jason Xing
Cc: Dmitry Antipov, Daniel Borkmann, Jakub Kicinski, Levi Zim,
Denis Yarapov, netdev, bpf, lvc-project, Sashiko
Le mar. 20 oct. 2026 à 08:23, Jason Xing <kerneljasonxing@gmail.com> a écrit :
>
> On Mon, Oct 19, 2026 at 4:27 PM Dmitry Antipov <dmantipov@yandex.ru> wrote:
> >
> > 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.
> >
> > Reported-by: Sashiko <shodan.ai@mcst.ru>
> > Fixes: 5153a75ef34b ("tcp_bpf: Fix copied value in tcp_bpf_sendmsg")
> > Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
>
> Reviewed-by: Jason Xing <kerneljasonxing@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@kernel.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-10-20 7:50 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-19 8:22 [PATCH v2] tcp_bpf: propagate error code in tcp_bpf_sendmsg() Dmitry Antipov
2026-10-19 8:28 ` netdev-bot+sinfo
2026-10-20 4:44 ` Kuniyuki Iwashima
2026-10-20 6:23 ` Jason Xing
2026-10-20 7:50 ` Eric Dumazet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox