mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fou: fix initialization of grc
@ 2024-09-06 10:28 Muhammad Usama Anjum
  2024-09-06 17:06 ` Kuniyuki Iwashima
  2024-09-10  0:40 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Muhammad Usama Anjum @ 2024-09-06 10:28 UTC (permalink / raw)
  To: David S. Miller, David Ahern, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Kuniyuki Iwashima
  Cc: Muhammad Usama Anjum, kernel, netdev, linux-kernel

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>
---
 net/ipv4/fou_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/fou_core.c b/net/ipv4/fou_core.c
index 78b869b314921..3e30745e2c09a 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);
 
-- 
2.39.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] fou: fix initialization of grc
  2024-09-06 10:28 [PATCH] fou: fix initialization of grc Muhammad Usama Anjum
@ 2024-09-06 17:06 ` Kuniyuki Iwashima
  2024-09-10  0:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Kuniyuki Iwashima @ 2024-09-06 17:06 UTC (permalink / raw)
  To: usama.anjum
  Cc: davem, dsahern, edumazet, kernel, kuba, kuniyu, linux-kernel,
	netdev, pabeni

From: Muhammad Usama Anjum <usama.anjum@collabora.com>
Date: Fri,  6 Sep 2024 15:28:39 +0500
> 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>

Thanks!


> ---
>  net/ipv4/fou_core.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/ipv4/fou_core.c b/net/ipv4/fou_core.c
> index 78b869b314921..3e30745e2c09a 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);
>  
> -- 
> 2.39.2

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] fou: fix initialization of grc
  2024-09-06 10:28 [PATCH] fou: fix initialization of grc Muhammad Usama Anjum
  2024-09-06 17:06 ` Kuniyuki Iwashima
@ 2024-09-10  0:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-09-10  0:40 UTC (permalink / raw)
  To: Muhammad Usama Anjum
  Cc: davem, dsahern, edumazet, kuba, pabeni, kuniyu, kernel, netdev,
	linux-kernel

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Fri,  6 Sep 2024 15:28:39 +0500 you wrote:
> 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>
> 
> [...]

Here is the summary with links:
  - fou: fix initialization of grc
    https://git.kernel.org/netdev/net/c/4c8002277167

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-09-10  0:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-06 10:28 [PATCH] fou: fix initialization of grc Muhammad Usama Anjum
2024-09-06 17:06 ` Kuniyuki Iwashima
2024-09-10  0:40 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®