Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1172658pxb; Tue, 26 Oct 2021 04:18:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiKQQJVPnrMJjQeKG4ciX18LpF9Jb3W8QHVzXAe6FxzLrb2UN/7cMCMZha40CMzEpLCZ2u X-Received: by 2002:a05:6a00:1882:b0:47c:138c:bbf2 with SMTP id x2-20020a056a00188200b0047c138cbbf2mr2388399pfh.9.1635247083863; Tue, 26 Oct 2021 04:18:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635247083; cv=none; d=google.com; s=arc-20160816; b=RcfODf8MbbCBsbL/GQy6XWcFb4yJpLtztcnl96QGsa/6T25scNKVEid52pFItaFosL UiBHKHgUHPITOsy7dtl5SVaM3wety2P6aMFnpbeI0RdkbAtLjCBETnXIlB2i3syb9Ers 0jm8ASn9yxclsUrOCISLhsC83HssAuAbeN1lx5rRs8nIbIIzmPcBffQJSNW3UDEKeaek 8mVgSTLhUQ5EB52Q/HLz/r4dnrjnLecpTiW7IAC6UBhdLbjHQgVRKyLctAkNk/yrPVls AgkiMVmUIMFUPQDggoG/oAm8p2cMUeD3GVocabwFj9jAwExzXVsoxyszI+AlVi9/pAe0 1LFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=I7YfSyelzy7SPOD/68bXsBPGsKRurvUCvEQxs14RBXU=; b=FU4G2IyviZ6fGhiNlCw7BuMHG0+maQ1Xl2SONLNX0K3M4wR+RSWtxuZ0RGHQsE8SHY EStWp5V3LwWTkvABkkKBDFpXhJtvVoUJ79m/V1nmtH69p+msJyAGTYygj8pz9YKhPUZQ +k5jK2tjaY6Vu8BB66yAr90MTGhXELJ3hxJSJqM2KbiPEsZIRGI7yG/Ai71Bh+RKxIH7 6ExOCsd/AQZrRT0584vgvrO1LpFUCSv7oFGpkU7ADKfmlpihE1sM/fosc2OhqxYh68PZ k1pOgf1zOg/dbZ35UW7r+4FOmpQYK4UIySSlgGVjWZQxD2er9eLOeqiDsE8c5nk3xP2p DZXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TjYgjSVO; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q3si33043606pfk.49.2021.10.26.04.17.22; Tue, 26 Oct 2021 04:18:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TjYgjSVO; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234518AbhJZJaE (ORCPT + 67 others); Tue, 26 Oct 2021 05:30:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234844AbhJZJ37 (ORCPT ); Tue, 26 Oct 2021 05:29:59 -0400 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C22DC061767; Tue, 26 Oct 2021 02:27:36 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id u13so11318306edy.10; Tue, 26 Oct 2021 02:27:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=I7YfSyelzy7SPOD/68bXsBPGsKRurvUCvEQxs14RBXU=; b=TjYgjSVOmnnMkWPm+jlRpAhJ/Jk4zFaOtVPc+6KH2wltPLi8+L2OGO2CneJJC8UzQ4 7uN/gaYQM5sKKA4mPCRw6qRskqSUiexL+wLCZvGO6aKLxmcqYDhLs7ZLJPI3uEo74OPM QQDssCjxvjKtBmAyiIF86XrgiPCLZsfLca5tBne2o/OTR/1qEGlGznZOWTgLco0Zl/Yv 1W9xKXW3i5JaZmpeAFtwM02TFYyLIwOELeI4IYqW9s28Z72ohycuNSw/4HtigRHBNk7M 7hY/nIXdhUnlHVr9niH8No+9GHmLET2CVEtb4zmIH7ejkcuQIcoQDDr9UnubMuhnip1r tUuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=I7YfSyelzy7SPOD/68bXsBPGsKRurvUCvEQxs14RBXU=; b=ZvRlblRK+RaZ/ycYLhe+cpbGq6yxyGw7/XAoiMlcMIMUtQEzNMRhIlTgbboEb/JOBG Xr+/ByWG3tI56pL5ahPM6ah66wFgcUcKoJWcyyqi+z3FxniNQWN0Y6YBDMoDf6HJFUmi EF6ydMx/pSbGj3qkrIaKyeKGvd5IQJzB/K4dcjGOL/StvbJAFlS8XYGhZ4TrLF8Xe2+i 7sl90WIHJM8Kp8mYbCiHP95S3B8hrPyt2jrNAD14yY3xe0jAnem+6ywI5SZG6NYRU/NI uBpxCs4IU9JQ0e/UoHmF21hMHjcg46c7YwkvSiNwCknzeBFndtUDzwcJhDe07vK10Tl9 GSWw== X-Gm-Message-State: AOAM530fx3YbtlJOuUujetA2PhOVGB1J/fSLp8pUkzcLD4PxyksQsRHk /30IUGCvFL0v6qfn8aNp6QA= X-Received: by 2002:a17:907:16aa:: with SMTP id hc42mr19148394ejc.491.1635240454691; Tue, 26 Oct 2021 02:27:34 -0700 (PDT) Received: from localhost.localdomain (host-80-181-148-119.retail.telecomitalia.it. [80.181.148.119]) by smtp.gmail.com with ESMTPSA id sh19sm6196023ejc.99.2021.10.26.02.27.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 02:27:34 -0700 (PDT) From: "Fabio M. De Francesco" 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 Subject: Re: [syzbot] memory leak in cfg80211_inform_single_bss_frame_data Date: Tue, 26 Oct 2021 11:27:31 +0200 Message-ID: <2678912.i2LAJy1QmT@localhost.localdomain> In-Reply-To: <000000000000e1063f05cf34f2a8@google.com> References: <000000000000e1063f05cf34f2a8@google.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart327050664.krEj5IxTLE" Content-Transfer-Encoding: 7Bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This is a multi-part message in MIME format. --nextPart327050664.krEj5IxTLE Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" 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 --nextPart327050664.krEj5IxTLE Content-Disposition: attachment; filename="scan_c_diff" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="UTF-8"; name="scan_c_diff" 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; --nextPart327050664.krEj5IxTLE--