2021-03-29 16:32:18

by Alaa Emad

[permalink] [raw]
Subject: [PATCH] wireless/nl80211.c: fix uninitialized variable

Reported-by: [email protected]
Signed-off-by: Alaa Emad <[email protected]>
---
net/wireless/nl80211.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

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,
--
2.25.1


2021-03-30 12:51:19

by Pavel Skripkin

[permalink] [raw]
Subject: Re: [PATCH] wireless/nl80211.c: fix uninitialized variable

Hi!

On Tue, 2021-03-30 at 14:42 +0200, Alaa Emad wrote:
>
>
> On Mon, 29 Mar 2021 at 20:58, Greg KH <[email protected]>
> wrote:
> > On Mon, Mar 29, 2021 at 08:41:38PM +0200, Alaa Emad wrote:
> > > On Mon, 29 Mar 2021 at 20:20, Greg KH <[email protected]>
> > wrote:
> > >
> > > > On Mon, Mar 29, 2021 at 06:30:36PM +0200, Alaa Emad wrote:
> > > > > Reported-by:
> > [email protected]
> > > > > Signed-off-by: Alaa Emad <[email protected]>
> > > >
> > > > 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 [email protected].
> 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