]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
fou: fix initialization of grc
authorMuhammad Usama Anjum <usama.anjum@collabora.com>
Fri, 6 Sep 2024 10:28:39 +0000 (15:28 +0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Sep 2024 17:24:09 +0000 (19:24 +0200)
[ 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>
net/ipv4/fou_core.c

index e0b8d6b17a34dcb1123bd42fcb3363632ee6b7ac..4e0a7d038e219c7c9071281779f4777aac04c075 100644 (file)
@@ -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);