udp: Validate checksum in udp_read_sock()
authorCong Wang <cong.wang@bytedance.com>
Mon, 15 Nov 2021 04:40:06 +0000 (20:40 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 16 Nov 2021 12:18:23 +0000 (13:18 +0100)
commit099f896f498a2b26d84f4ddae039b2c542c18b48
tree0b9515284b4d457b6d265a367752a7f1ab309ce2
parent353050be4c19e102178ccc05988101887c25ae53
udp: Validate checksum in udp_read_sock()

It turns out the skb's in sock receive queue could have bad checksums, as
both ->poll() and ->recvmsg() validate checksums. We have to do the same
for ->read_sock() path too before they are redirected in sockmap.

Fixes: d7f571188ecf ("udp: Implement ->read_sock() for sockmap")
Reported-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Cong Wang <cong.wang@bytedance.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/20211115044006.26068-1-xiyou.wangcong@gmail.com
net/ipv4/udp.c