linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Fabio M. De Francesco" <fmdefrancesco@gmail.com>
To: davem@davemloft.net, johannes@sipsolutions.net, kuba@kernel.org,
	linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org,
	mudongliangabcd@gmail.com, netdev@vger.kernel.org,
	phind.uet@gmail.com, syzkaller-bugs@googlegroups.com
Cc: syzbot <syzbot+7a942657a255a9d9b18a@syzkaller.appspotmail.com>
Subject: Re: [syzbot] memory leak in cfg80211_inform_single_bss_frame_data
Date: Tue, 26 Oct 2021 11:27:31 +0200	[thread overview]
Message-ID: <2678912.i2LAJy1QmT@localhost.localdomain> (raw)
In-Reply-To: <000000000000e1063f05cf34f2a8@google.com>

[-- Attachment #1: Type: text/plain, Size: 973 bytes --]

On Tuesday, October 26, 2021 12:33:23 AM CEST syzbot wrote:
> syzbot has found a reproducer for the following issue on:
> 
> HEAD commit:    87066fdd2e30 Revert "mm/secretmem: use refcount_t instead 
..
> git tree:       upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=16b55554b00000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=d25eeb482b0f99b
> dashboard link: https://syzkaller.appspot.com/bug?
extid=7a942657a255a9d9b18a
> compiler:       gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils 
for Debian) 2.35.2
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=171cf464b00000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=1396b19f300000
> 
> IMPORTANT: if you fix the issue, please add the following tag to the 
commit:
> Reported-by: syzbot+7a942657a255a9d9b18a@syzkaller.appspotmail.com
> 
> BUG: memory leak
> unreferenced object 0xffff88810f3c7980 (size 96):

Let's try the attached diff.

Fabio

[-- Attachment #2: scan_c_diff --]
[-- Type: text/x-patch, Size: 442 bytes --]

diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index 11c68b159324..e84855ea4075 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -2380,7 +2380,7 @@ cfg80211_inform_single_bss_frame_data(struct wiphy *wiphy,
 		capability = le16_to_cpu(mgmt->u.probe_resp.capab_info);
 	}
 
-	ies = kzalloc(sizeof(*ies) + ielen, gfp);
+	ies = kzalloc(sizeof(cfg80211_bss_ies) + ielen, gfp);
 	if (!ies)
 		return NULL;
 	ies->len = ielen;

  reply	other threads:[~2021-10-26  9:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-02 16:37 [syzbot] memory leak in cfg80211_inform_single_bss_frame_data syzbot
2021-10-25 22:33 ` syzbot
2021-10-26  9:27   ` Fabio M. De Francesco [this message]
2022-07-13  8:56 ` Siddh Raman Pant
2022-07-13  8:58   ` Siddh Raman Pant
2022-07-13  9:08     ` syzbot
2022-07-13 10:25       ` Siddh Raman Pant
2022-07-13 10:35         ` syzbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2678912.i2LAJy1QmT@localhost.localdomain \
    --to=fmdefrancesco@gmail.com \
    --cc=davem@davemloft.net \
    --cc=johannes@sipsolutions.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mudongliangabcd@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=phind.uet@gmail.com \
    --cc=syzbot+7a942657a255a9d9b18a@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).