ip_gre: add validation for csum_start
authorShreyansh Chouhan <chouhan.shreyansh630@gmail.com>
Sat, 21 Aug 2021 07:14:24 +0000 (12:44 +0530)
committerPDO SCM Team <hudsoncm@motorola.com>
Thu, 30 Dec 2021 08:42:11 +0000 (02:42 -0600)
commit0a2c717b65b4c563b3439ec84bdafff15c61f6d4
tree7b0b345b09105d385cd93957028d547d65c5d6e9
parent2dd7d13d5c0516660b731167afe81e9be57b7b4e
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.

Mot-CRs-fixed: (CR)
CVE-Fixed: CVE-2021-39633
Bug: 150694665

Change-Id: I6e4d15fe38087e578434938959ff19e3252c951d
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>
Signed-off-by: Gajjala Chakradhar <gajjalac@motorola.com>
Reviewed-on: https://gerrit.mot.com/2152182
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
net/ipv4/ip_gre.c