ip_gre: add validation for csum_start
authorShreyansh Chouhan <chouhan.shreyansh630@gmail.com>
Sat, 21 Aug 2021 07:14:24 +0000 (12:44 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Sep 2021 07:56:25 +0000 (09:56 +0200)
commit99279223a37b46dc7716ec4e0ed4b3e03f1cfa4c
tree067f07b937c8de3071fd62ccbb089b8fdd5029b5
parent82657502ef1f71bbe88144df7b43e55b6650a5c2
ip_gre: add validation for csum_start

[ Upstream commit 1d011c4803c72f3907eccfc1ec63caefb852fcbf ]

Validate csum_start in gre_handle_offloads before we call _gre_xmit so
that we do not crash later when the csum_start value is used in the
lco_csum function call.

This patch deals with ipv4 code.

Fixes: c54419321455 ("GRE: Refactor GRE tunneling code.")
Reported-by: syzbot+ff8e1b9f2f36481e2efc@syzkaller.appspotmail.com
Signed-off-by: Shreyansh Chouhan <chouhan.shreyansh630@gmail.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/ipv4/ip_gre.c