]> git.baikalelectronics.ru Git - kernel.git/commit
bpf, sockmap: Do not ignore orig_len parameter
authorEric Dumazet <edumazet@google.com>
Wed, 2 Mar 2022 16:17:22 +0000 (08:17 -0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 3 Mar 2022 06:49:03 +0000 (22:49 -0800)
commit08b6026a0e2c0ff7c3c90799dc6360c307f71da2
tree9f4db2b6e73ce9cca1e0197b5ee97d02e15433e4
parent930bbbe01b1dc303a583f714dd35029bb9eb6b8a
bpf, sockmap: Do not ignore orig_len parameter

Currently, sk_psock_verdict_recv() returns skb->len

This is problematic because tcp_read_sock() might have
passed orig_len < skb->len, due to the presence of TCP urgent data.

This causes an infinite loop from tcp_read_sock()

Followup patch will make tcp_read_sock() more robust vs bad actors.

Fixes: 0d01bf94def1 ("bpf, sockmap: Allow skipping sk_skb parser program")
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Acked-by: Jakub Sitnicki <jakub@cloudflare.com>
Tested-by: Jakub Sitnicki <jakub@cloudflare.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/r/20220302161723.3910001-1-eric.dumazet@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/skmsg.c