summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorMuhammad Usama Anjum <usama.anjum@collabora.com>2024-09-06 15:28:39 +0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-09-18 19:25:15 +0200
commitaca06c617c83295f0caa486ad608fbef7bdc11e8 (patch)
tree52e99a92e93bb3c2b4760d67c38e7f1b47a98112 /net
parent505ae01f75f839b54329164bbfecf24cc1361b31 (diff)
downloadlinux-aca06c617c83295f0caa486ad608fbef7bdc11e8.tar.gz
linux-aca06c617c83295f0caa486ad608fbef7bdc11e8.tar.bz2
linux-aca06c617c83295f0caa486ad608fbef7bdc11e8.zip
fou: fix initialization of grc
[ Upstream commit 4c8002277167125078e6b9b90137bdf443ebaa08 ] The grc must be initialize first. There can be a condition where if fou is NULL, goto out will be executed and grc would be used uninitialized. Fixes: 7e4196935069 ("fou: Fix null-ptr-deref in GRO.") Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com> Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com> Link: https://patch.msgid.link/20240906102839.202798-1-usama.anjum@collabora.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/fou_core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/fou_core.c b/net/ipv4/fou_core.c
index 78b869b31492..3e30745e2c09 100644
--- a/net/ipv4/fou_core.c
+++ b/net/ipv4/fou_core.c
@@ -336,11 +336,11 @@ static struct sk_buff *gue_gro_receive(struct sock *sk,
struct gro_remcsum grc;
u8 proto;
+ skb_gro_remcsum_init(&grc);
+
if (!fou)
goto out;
- skb_gro_remcsum_init(&grc);
-
off = skb_gro_offset(skb);
len = off + sizeof(*guehdr);