From patchwork Thu May 10 08:50:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 10391431 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 482C960353 for ; Thu, 10 May 2018 08:51:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3573C28948 for ; Thu, 10 May 2018 08:51:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 337A228969; Thu, 10 May 2018 08:51:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 01F1E28957 for ; Thu, 10 May 2018 08:51:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756858AbeEJIvM (ORCPT ); Thu, 10 May 2018 04:51:12 -0400 Received: from mail-by2nam03on0066.outbound.protection.outlook.com ([104.47.42.66]:47232 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756828AbeEJIvJ (ORCPT ); Thu, 10 May 2018 04:51:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quantenna.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=BTmvtmitHYKUSBSc6Jpk3dSbVaAfm83eXmsF0s+ao5U=; b=YodNX0/cvKwgrJfPmCLpikjPUiytwo5VJcVI3j+TcuypsViV+6y0zZWwtY4ia3vig51dBZOoktHvdSQsF//tZHs9Z6RPK4YWOelE2psA01EfHIruuw9d6P/SGEZR1gcACzUQB8ypfpEQ20R8hW8xZ2gWGU3z2rlZ4n0GtgMC5aY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=sergey.matyukevich.os@quantenna.com; Received: from bars (195.182.157.78) by SN1PR05MB1933.namprd05.prod.outlook.com (2a01:111:e400:523b::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.755.10; Thu, 10 May 2018 08:51:02 +0000 Date: Thu, 10 May 2018 11:50:53 +0300 From: Sergey Matyukevich To: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= Cc: linux-wireless@vger.kernel.org, Igor Mitsyanko Subject: Re: [PATCH v2 1/3] wireless-drivers: Dynamically allocate struct station_info Message-ID: <20180510085052.oscm2ezf4k6p2kwf@bars> Mail-Followup-To: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= , linux-wireless@vger.kernel.org, Igor Mitsyanko References: <152590211357.13924.18408619969539206421.stgit@alrua-kau> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <152590211357.13924.18408619969539206421.stgit@alrua-kau> User-Agent: NeoMutt/20170113 (1.7.2) X-Originating-IP: [195.182.157.78] X-ClientProxiedBy: AM0PR07CA0019.eurprd07.prod.outlook.com (2603:10a6:208:ac::32) To SN1PR05MB1933.namprd05.prod.outlook.com (2a01:111:e400:523b::11) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:SN1PR05MB1933; X-Microsoft-Exchange-Diagnostics: 1; SN1PR05MB1933; 3:s+sh5EvM2K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Ji+TtSjhgDy1OnJucF/SfiO1Sws5RC+4iIzDvDn856n0ueIy5Fqhr/xok9fIzgQVL16zunrXjU9pKCY3OOMapvzrnyiErNyMaTjFdOSnpVaLc7qnbIs1AOufKna5qz5sSlC5BXlsYyKJkhNyS65AdLuGr0gKBTXMuACHksxZuDcVWtSQxxjOX4/ECFvnGsUV+nlIXS+Q+x5U7rGmhxc1IuMRDrCx/J9bbxdN0cEfvogFXbPbWpRG0wWfOfeJNrmFqDkG5VHpMgsTOq3OEYN3TeEEbHdYgfpw1bZrmFdrKkB9qj+wKHdszdV31ypg5rYS0BcNDBYsJY; 4:3ll/pifhBLVThrMC4lxVSOoaLMxmmsoZ6bZC2t2KTx+WGlIYUE1owMaX+kTtHuaYcaeiPscRm/W7EF3+PvTK0+bhf3eGVo/RJQ2BHpEux0lIDJmuEIxGQO/GvueE2MfjcFud2z/2jw216khB9SSBxz1/3SuWuzzGN8iKhdagbXlyVZpI9A+CSt1hdtXNu6ifKPSFOFFDoRGJRuSJb+c04tNrLD9Ux6YZw3T9V70dZ6yAe5A611eDgx/aXvL4PqjB+ocWRQHSWGlGjsfqm9496A== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(3231254)(944501410)(52105095)(93006095)(93001095)(10201501046)(3002001)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:SN1PR05MB1933; BCL:0; PCL:0; RULEID:; SRVR:SN1PR05MB1933; X-Forefront-PRVS: 066898046A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39840400004)(346002)(376002)(396003)(366004)(39380400002)(189003)(199004)(47776003)(8676002)(97736004)(25786009)(66066001)(6666003)(68736007)(2906002)(5660300001)(6916009)(55016002)(7736002)(2870700001)(9686003)(229853002)(4326008)(107886003)(6246003)(26005)(81156014)(305945005)(81166006)(8936002)(478600001)(50466002)(106356001)(53936002)(86362001)(76176011)(3846002)(33896004)(6116002)(33716001)(446003)(186003)(16526019)(956004)(11346002)(386003)(6496006)(23676004)(2486003)(1076002)(316002)(105586002)(476003)(52116002)(58126008)(52146003)(486006); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR05MB1933; H:bars; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtTTjFQUjA1TUIxOTMzOzIzOjZHT0NWVDB6RksrRGhhaUhmdnVwQy94eGI1?= =?utf-8?B?ZEQ4VWE4MHNEOXdoWmZnWSszSGFFaGZFRG5HZ2FoL0t1Mm9aV2NOY1FZYjgw?= =?utf-8?B?VUFqcFlRNU9QY1NnQTZVVDFPVkMralJrTzNuRVBJUUFKUjV0ZzcrUittSjhk?= =?utf-8?B?UXJHTHM0WjdvT1B3ck1tSStuNU1qVTdEa1lvenJ3cUx2OG9nSEtLcGlJMVJJ?= =?utf-8?B?SUZiNHhtS24zVGwyc21pNFVCQ25QNkZWbHZESHNNNGVWMDhuZG1oU0JvZEs3?= =?utf-8?B?TVJWSnZQaHRlSUxMWUQ1NDhrdk1wZXVtZDIwdGNJVGlTVkR6WitNQmdISjZZ?= =?utf-8?B?WWlpaWR1a2ZCRWpjVmxJZVdpcFNaR1BCUFhUTkFEWTBLQ2w0eXhSVjRIRXlq?= =?utf-8?B?QzVjSlJRTTNtMk5KQWZBbkZPS0lDVTYwMFlBelVFVEFVclFXZGFkSnM0NlJZ?= =?utf-8?B?Y1IwalU3RmdCSkVMSGkzMUFPTW81UHBDMzJqeTF5aXlHa2t5YitPTWc0M2Vr?= =?utf-8?B?cU5pKzJUWmtLVmN2dnE0T2VxeU01dTIwdXBOc3VTRUNIZXc0Z0pkamR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ZIPuFUHe0IJpcLraOAeV2NMk4PbAD/6tOv/Kw/BIZN3DoLQMUfT6MNLEt4rYtpytK64Y5CpcB0Dw4ZoFSvZXGM/VN98CqNtd8cGiyE3F6dChBAjr5/IvJYRiEEkA8ZyuE3Ca8qjGzvrywjcJIk74tHerMg2E54LVh8nRBro=; 24:jU/adVyXussAwEhjRXzPxHnjk89pBQod8QZdqLiIgohIiQ++247LPueznFMUO5XxfXoA2rkopelziRUAGgGP6ma2TVvr0ohlCelucb8WLZk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR05MB1933; 7:N8eGA82okIhQpT0Rw+JFIL9YdO1GKke04yrnHp7sBa+8423bU4lcEiLELNuUZ/EhfJrBJACYVdl+feBSzwkZrvwVjNC0TtHccwO/ModM91QS5z0i+sjBvFWPwPM6Ag4HJTrWuEJkbITRir88aSJge4y812w2Loli5lKqwMBmkiFwVXejHMx9Scigaw1hqgvQz4LwTqi4QKqR1bB1+C5Za4yyE/3J42tcgb+z4VzHWwq2kwESPpyUH/0JxvmN4uQ7 X-MS-Office365-Filtering-Correlation-Id: 53d48f5c-b15b-40f9-f27f-08d5b653290b X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2018 08:51:02.0775 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 53d48f5c-b15b-40f9-f27f-08d5b653290b X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR05MB1933 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hello Toke and all, > Since the addition of the TXQ stats to cfg80211, the station_info struct > has grown to be quite large, which results in warnings when allocated on > the stack. Fix the affected places to do dynamic allocations instead. > > Fixes: 52539ca89f36 ("cfg80211: Expose TXQ stats and parameters to userspace") > Signed-off-by: Toke Høiland-Jørgensen > --- > drivers/net/wireless/ath/ath6kl/main.c | 14 ++++++---- > drivers/net/wireless/ath/wil6210/debugfs.c | 22 ++++++++++----- > drivers/net/wireless/ath/wil6210/wmi.c | 19 ++++++++----- > .../broadcom/brcm80211/brcmfmac/cfg80211.c | 18 ++++++++---- > drivers/net/wireless/marvell/mwifiex/uap_event.c | 25 +++++++++++------ > drivers/net/wireless/quantenna/qtnfmac/event.c | 29 +++++++++++++------- > 6 files changed, 82 insertions(+), 45 deletions(-) Thanks for taking care of this. As for qtnfmac part, there are two more EINVALs returned during payload processing. So they should be modified as well to avoid memleaks. Here is a fixup on top of your patch: Regards, Sergey diff --git a/drivers/net/wireless/quantenna/qtnfmac/event.c b/drivers/net/wireless/quantenna/qtnfmac/event.c index 969b6fc7128a..16617c44f81b 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/event.c +++ b/drivers/net/wireless/quantenna/qtnfmac/event.c @@ -78,15 +78,19 @@ qtnf_event_handle_sta_assoc(struct qtnf_wmac *mac, struct qtnf_vif *vif, tlv_value_len = le16_to_cpu(tlv->len); tlv_full_len = tlv_value_len + sizeof(struct qlink_tlv_hdr); - if (tlv_full_len > payload_len) - return -EINVAL; + if (tlv_full_len > payload_len) { + ret = -EINVAL; + goto out; + } if (tlv_type == QTN_TLV_ID_IE_SET) { const struct qlink_tlv_ie_set *ie_set; unsigned int ie_len; - if (payload_len < sizeof(*ie_set)) - return -EINVAL; + if (payload_len < sizeof(*ie_set)) { + ret = -EINVAL; + goto out; + } ie_set = (const struct qlink_tlv_ie_set *)tlv; ie_len = tlv_value_len -