diff mbox series

wireless/nl80211.c: fix uninitialized variable

Message ID 20210329163036.135761-1-alaaemadhossney.ae@gmail.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series wireless/nl80211.c: fix uninitialized variable | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Guessed tree name to be net-next
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link

Commit Message

Alaa Emad March 29, 2021, 4:30 p.m. UTC
Reported-by: syzbot+72b99dcf4607e8c770f3@syzkaller.appspotmail.com
Signed-off-by: Alaa Emad <alaaemadhossney.ae@gmail.com>
---
 net/wireless/nl80211.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Greg Kroah-Hartman March 29, 2021, 6:20 p.m. UTC | #1
On Mon, Mar 29, 2021 at 06:30:36PM +0200, Alaa Emad wrote:
> Reported-by: syzbot+72b99dcf4607e8c770f3@syzkaller.appspotmail.com
> Signed-off-by: Alaa Emad <alaaemadhossney.ae@gmail.com>

You need to provide some changelog text here, I know I can not take
patches without that, maybe the wireless maintainer is more flexible :)

thanks,

greg k-h
Greg Kroah-Hartman March 29, 2021, 6:58 p.m. UTC | #2
On Mon, Mar 29, 2021 at 08:41:38PM +0200, Alaa Emad wrote:
> On Mon, 29 Mar 2021 at 20:20, Greg KH <gregkh@linuxfoundation.org> wrote:
> 
> > On Mon, Mar 29, 2021 at 06:30:36PM +0200, Alaa Emad wrote:
> > > Reported-by: syzbot+72b99dcf4607e8c770f3@syzkaller.appspotmail.com
> > > Signed-off-by: Alaa Emad <alaaemadhossney.ae@gmail.com>
> >
> > You need to provide some changelog text here, I know I can not take
> > patches without that, maybe the wireless maintainer is more flexible :)
> >
>  you mean explain what i did , right?

Yes, explain why this change is needed.

thanks,

greg k-h
Pavel Skripkin March 30, 2021, 12:48 p.m. UTC | #3
Hi!

On Tue, 2021-03-30 at 14:42 +0200, Alaa Emad wrote:
> 
> 
> On Mon, 29 Mar 2021 at 20:58, Greg KH <gregkh@linuxfoundation.org>
> wrote:
> > On Mon, Mar 29, 2021 at 08:41:38PM +0200, Alaa Emad wrote:
> > > On Mon, 29 Mar 2021 at 20:20, Greg KH <gregkh@linuxfoundation.org>
> > wrote:
> > > 
> > > > On Mon, Mar 29, 2021 at 06:30:36PM +0200, Alaa Emad wrote:
> > > > > Reported-by:
> > syzbot+72b99dcf4607e8c770f3@syzkaller.appspotmail.com
> > > > > Signed-off-by: Alaa Emad <alaaemadhossney.ae@gmail.com>
> > > > 
> > > > You need to provide some changelog text here, I know I can not
> > take
> > > > patches without that, maybe the wireless maintainer is more
> > flexible :)
> > > > 
> > >   you mean explain what i did , right?
> > 
> > Yes, explain why this change is needed.
> > 
> 
> 
>   
>   This change fix  KMSAN uninit-value in net/wireless/nl80211.c:225 ,
> That because of `fixedlen` variable uninitialized. 
>    So I initialized it by zero because the code assigned value to it
> after that and doesn't depend on any stored value in it . 

You should add this message to the patch, not just write it to
maintainer.

I think, this link might be
useful https://www.kernel.org/doc/html/v4.17/process/submitting-patches.html

> > 
> > thanks,
> > 
> > greg k-h
> > 
> 
> 
> 
> Thanks ,
> Alaa
> -- 
> You received this message because you are subscribed to the Google
> Groups "syzkaller" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to syzkaller+unsubscribe@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/syzkaller/CAM1DhOjWgN_0GVBeX%2Bpf%2B9mk_ysaN9pF4agAFUNEkzhxpFR4%3Dw%40mail.gmail.com
> .

With regards,
Pavel Skripkin
diff mbox series

Patch

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 775d0c4d86c3..b87ab67ad33d 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -210,7 +210,7 @@  static int validate_beacon_head(const struct nlattr *attr,
 	const struct element *elem;
 	const struct ieee80211_mgmt *mgmt = (void *)data;
 	bool s1g_bcn = ieee80211_is_s1g_beacon(mgmt->frame_control);
-	unsigned int fixedlen, hdrlen;
+	unsigned int fixedlen = 0, hdrlen;
 
 	if (s1g_bcn) {
 		fixedlen = offsetof(struct ieee80211_ext,