diff mbox series

llc: fix uninit-value in __llc_lookup_established

Message ID tencent_269592755DA55D9B19384F870D9D25B18D07@qq.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series llc: fix uninit-value in __llc_lookup_established | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1116 this patch: 1116
netdev/cc_maintainers warning 2 maintainers not CCed: kuniyu@amazon.com willemb@google.com
netdev/build_clang success Errors and warnings before: 1142 this patch: 1142
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1143 this patch: 1143
netdev/checkpatch warning CHECK: Unbalanced braces around else statement
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Edward Adam Davis Dec. 6, 2023, 1:55 a.m. UTC
llc only supports ETH_P_802_2 protocol, so drop the skb when the protocol is 
not it.

Reported-by: syzbot+b5ad66046b913bc04c6f@syzkaller.appspotmail.com
Signed-off-by: Edward Adam Davis <eadavis@qq.com>
---
 net/llc/llc_input.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Kuniyuki Iwashima Dec. 6, 2023, 6:27 a.m. UTC | #1
From: Edward Adam Davis <eadavis@qq.com>
Date: Wed,  6 Dec 2023 09:55:15 +0800
> llc only supports ETH_P_802_2 protocol, so drop the skb when the protocol is 
> not it.

This is not true.  ETH_P_TR_802_2 is also processed by llc_rcv().

Let me post this formally.
https://lore.kernel.org/netdev/20231206005340.11534-1-kuniyu@amazon.com/

> 
> Reported-by: syzbot+b5ad66046b913bc04c6f@syzkaller.appspotmail.com
> Signed-off-by: Edward Adam Davis <eadavis@qq.com>
> ---
>  net/llc/llc_input.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/net/llc/llc_input.c b/net/llc/llc_input.c
> index 51bccfb00a9c..16b2c57f38c2 100644
> --- a/net/llc/llc_input.c
> +++ b/net/llc/llc_input.c
> @@ -141,7 +141,8 @@ static inline int llc_fixup_skb(struct sk_buff *skb)
>  			return 0;
>  		if (unlikely(pskb_trim_rcsum(skb, data_size)))
>  			return 0;
> -	}
> +	} else
> +		return 0;
>  	return 1;
>  }
>  
> -- 
> 2.43.0
diff mbox series

Patch

diff --git a/net/llc/llc_input.c b/net/llc/llc_input.c
index 51bccfb00a9c..16b2c57f38c2 100644
--- a/net/llc/llc_input.c
+++ b/net/llc/llc_input.c
@@ -141,7 +141,8 @@  static inline int llc_fixup_skb(struct sk_buff *skb)
 			return 0;
 		if (unlikely(pskb_trim_rcsum(skb, data_size)))
 			return 0;
-	}
+	} else
+		return 0;
 	return 1;
 }