net: geneve: check skb is large enough for IPv4/IPv6 header
authorPhillip Potter <phil@philpotter.co.uk>
Sun, 11 Apr 2021 11:28:24 +0000 (12:28 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Apr 2021 11:40:01 +0000 (13:40 +0200)
commit66d0cf7dcaa1093b7bc3f6e8995240b8be8b287d
treef6d0af81da01000e05d8e05b191a8de8f721277a
parent6ce64437224df9f28bb4bc17a4b5363560dcc79a
net: geneve: check skb is large enough for IPv4/IPv6 header

[ Upstream commit 6628ddfec7580882f11fdc5c194a8ea781fdadfa ]

Check within geneve_xmit_skb/geneve6_xmit_skb that sk_buff structure
is large enough to include IPv4 or IPv6 header, and reject if not. The
geneve_xmit_skb portion and overall idea was contributed by Eric Dumazet.
Fixes a KMSAN-found uninit-value bug reported by syzbot at:
https://syzkaller.appspot.com/bug?id=abe95dc3e3e9667fc23b8d81f29ecad95c6f106f

Suggested-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot+2e406a9ac75bb71d4b7a@syzkaller.appspotmail.com
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/geneve.c