Commit a1519bad authored by Muhammad Usama Anjum's avatar Muhammad Usama Anjum Committed by Wen Zhiwei
Browse files

fou: fix initialization of grc

stable inclusion
from stable-v6.6.52
commit 7ae890ee19479eeeb87724cca8430b5cb3660c74
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IAYXOD

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=7ae890ee19479eeeb87724cca8430b5cb3660c74



--------------------------------

[ 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: default avatarMuhammad Usama Anjum <usama.anjum@collabora.com>
Reviewed-by: default avatarKuniyuki Iwashima <kuniyu@amazon.com>
Link: https://patch.msgid.link/20240906102839.202798-1-usama.anjum@collabora.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarWen Zhiwei <wenzhiwei@kylinos.cn>
parent 4c2e9c5c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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);