diff mbox series

wireless/nl80211.c: fix uninitialized variable

Message ID 20210329163036.135761-1-alaaemadhossney.ae@gmail.com
State Superseded
Headers show
Series wireless/nl80211.c: fix uninitialized variable | expand

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

Pavel Skripkin March 30, 2021, 12:48 p.m. UTC | #1
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,