From patchwork Tue May 29 12:00:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 10435113 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 102FE602CC for ; Tue, 29 May 2018 12:00:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 005C928724 for ; Tue, 29 May 2018 12:00:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E91CE28733; Tue, 29 May 2018 12:00:58 +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 7B92828724 for ; Tue, 29 May 2018 12:00:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933580AbeE2MAi (ORCPT ); Tue, 29 May 2018 08:00:38 -0400 Received: from mail-by2nam03on0088.outbound.protection.outlook.com ([104.47.42.88]:23410 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933559AbeE2MAc (ORCPT ); Tue, 29 May 2018 08:00:32 -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:X-MS-Exchange-SenderADCheck; bh=AI1osMT7NJRbNogBpXMK58U3LuQNlokuxQUyP4zIv7E=; b=wmEazMywNn+X9RK8XllKd/fYsl+rsih2OFT1r+iOUu1r4Z1U7AiYhmAADvOyq9lJIVtvzDLd5OO4gEtfx2xpu1irSRgmiqugpW81SEABGwkQOjMIjPCSIUaZyPxdixqqDOs3HZdxEnguhiAHnysheS6cWNPFsZe90kb7IgrjQMc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=sergey.matyukevich.os@quantenna.com; Received: from bars.quantenna.com (195.182.157.78) by BLUPR05MB1923.namprd05.prod.outlook.com (2a01:111:e400:52ad::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.820.5; Tue, 29 May 2018 12:00:25 +0000 From: Sergey Matyukevich To: linux-wireless@vger.kernel.org Cc: Igor Mitsyanko , Andrey Shevchenko , Sergei Maksimenko , Dmitry Lebed , Sergey Matyukevich Subject: [PATCH 4/9] qtnfmac: cleanup wdev structure between its uses Date: Tue, 29 May 2018 15:00:00 +0300 Message-Id: <20180529120005.21498-5-sergey.matyukevich.os@quantenna.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180529120005.21498-1-sergey.matyukevich.os@quantenna.com> References: <20180529120005.21498-1-sergey.matyukevich.os@quantenna.com> MIME-Version: 1.0 X-Originating-IP: [195.182.157.78] X-ClientProxiedBy: AM6PR03CA0031.eurprd03.prod.outlook.com (2603:10a6:20b::44) To BLUPR05MB1923.namprd05.prod.outlook.com (2a01:111:e400:52ad::13) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:BLUPR05MB1923; X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB1923; 3:lC7EeG3XLZdqP99wkKXODl0G0s5yRm5oJ5ihKUEDcKFXex2UW7su9zM99Pv0G4B3GZufb859mVh6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/6ui1vqblkewYcR/ZwG+KV/QDW99lBzJmQI9Zgcz7/Y/gMiWqygzQty5MR6MOhmldHHX5aU2xoHTr0DOXXUAeQt0ei63IKXyad5ZfGNX3uDa3Xtb76hCST1drINRIadaloVtJpMtWpCjG3NFBm7ek4ozpMGbkK6IWRcZ1/vlVqpXM6nmd0Xek0xx43yscwmJP78ZpRZdOC86ijFS+sUDdwnCjqNILxs6Dw4Ih9+u29fUf2PdzXOgS539t1LTAOmrNFZAmWPmeWts6LanE5A2biqfiPbpxrBIsM3gxP4Mm6C; 4:/771eOZq/adiTKY51p+IO1SjyPeO8g+baIt6VbbwXet5JXPhj+z9XaO1FiXD79b/pwz4Q+R0itTqEzV4Jmu14P4LAUtc0HhFtxHjLVTTMmYadwIL3oCEBA+QDUnIIej8jV+ZpTm+d/8Y8VwRm32njeGnLOpZVRiaU2sNRoNZCotDwwwHXCUgKDZGMB0QaG7oWOeUvYdblvCJy5wVHytQOh6ehLgzaO3+lIcBw1I4RKAaeJ0fevFhUUeoNZLDwnUD1uH+gwcYTNFX3Wxdp+YEYg== 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)(93006095)(93001095)(3002001)(3231254)(944501410)(52105095)(10201501046)(149027)(150027)(6041310)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:BLUPR05MB1923; BCL:0; PCL:0; RULEID:; SRVR:BLUPR05MB1923; X-Forefront-PRVS: 0687389FB0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39840400004)(396003)(366004)(39380400002)(376002)(346002)(199004)(189003)(2361001)(2616005)(11346002)(51416003)(956004)(50466002)(107886003)(50226002)(48376002)(97736004)(446003)(478600001)(2906002)(476003)(86362001)(106356001)(81166006)(76176011)(66066001)(105586002)(3846002)(47776003)(6116002)(7696005)(486006)(81156014)(316002)(186003)(1076002)(53416004)(36756003)(25786009)(26005)(16526019)(103116003)(68736007)(54906003)(52116002)(6916009)(5660300001)(7736002)(69596002)(6666003)(305945005)(8676002)(16586007)(4326008)(386003)(2351001)(53936002)(8936002)(5890100001)(6486002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR05MB1923; H:bars.quantenna.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR05MB1923; 23:aTqmLxJmQyFDX+p3JyFS/YoTvz5LA/BwHXAvAsvG2?= =?us-ascii?Q?OT6CE+h3CMl3/Ymovr4jUmDGqvUv8TwdlAZb6Gc4ieBIOhi0jv8VqTNiH7Xo?= =?us-ascii?Q?7QUg7QBBTdmbDBDaGUpnY3OSm4Jtyma1g7+E+sLni9h5TU9MjBR6AWll7uw1?= =?us-ascii?Q?WISRkbnQeaEa8muMcADD6C3LTxe1AWJWDWMvuu9GCvPM/mwW/K6B8AynhBq2?= =?us-ascii?Q?xEhNEts0JUmT/B2PyhovZvPNxz7kpX6QY3EHAULVpdM0GCYIJOmulWLi48Cr?= =?us-ascii?Q?i0K2TN6XTqrkcgWcla9Shs+fwtrEJJjD+ylkyZk5NCm/kRuLE4SuLg9sDUdS?= =?us-ascii?Q?vXyqRbkHyr+HGRF30wXCIhjWTIJfKxALsbGeRyxYUCtAwJ6tOr0NFDK45iPJ?= =?us-ascii?Q?VSQd3dBMETXcXZc8i5tNOPUWyd73zUuTpA5sFkTRkxrtFbEPC0Sa5hDFCkWd?= =?us-ascii?Q?1+yrqIqaSP4CgHu1iOdOvtaVHlArlZ9rgq7G7hM4HPc7K2AqKPGDCrjpqtsM?= =?us-ascii?Q?Ne3GxY0FSc+Lb50SPPR4CWK1cTaCf/Vv2Gv1WJABQ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fM6GbTlRLWI/fZiLz93CBE8Y3ff5Qshl4ORoGjSr3JHRrXg5xmOD9Y6YD0VCsg4FXGbK7syhabvFHGROgIGn0Z3pLq+yZUN+Ym97ic3XnapNZbY82XWFTLWdfYDSqXgkmax8kJrq7T5RHg3mJNnLSZPnEx6HVr4j+bhG8UKDJIV0eXMPxHHIQOYhTMgP4/ZIEgrcRAVXGo3zDgHnEHbv5 X-MS-Office365-Filtering-Correlation-Id: ce605526-e5cd-45a7-77f5-08d5c55bc40f X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 May 2018 12:00:25.3767 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ce605526-e5cd-45a7-77f5-08d5c55bc40f X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR05MB1923 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 Driver uses statically allocated wdev structures for each virtual interface. However wdev structure is not properly cleaned up between its uses. As a result, various bugs appear when userspace tools like hostapd were not gracefully stopped. In particular, this commit fixes the following issue: - start hostapd with more than 2 mBSS - kill hostapd using SIGKILL - start again hostapd with more than 2 mBSS However only two mBSS entities will be started: primary and the last BSS listed in hostapd config. Signed-off-by: Sergey Matyukevich --- drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 8 +++----- drivers/net/wireless/quantenna/qtnfmac/core.c | 1 - 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c index bf624d975953..2089cb095283 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c +++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c @@ -177,8 +177,6 @@ int qtnf_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev) vif->netdev->ieee80211_ptr = NULL; vif->netdev = NULL; vif->wdev.iftype = NL80211_IFTYPE_UNSPECIFIED; - eth_zero_addr(vif->mac_addr); - eth_zero_addr(vif->bssid); return 0; } @@ -216,10 +214,12 @@ static struct wireless_dev *qtnf_add_virtual_intf(struct wiphy *wiphy, } eth_zero_addr(vif->mac_addr); + eth_zero_addr(vif->bssid); vif->bss_priority = QTNF_DEF_BSS_PRIORITY; + vif->sta_state = QTNF_STA_DISCONNECTED; + memset(&vif->wdev, 0, sizeof(vif->wdev)); vif->wdev.wiphy = wiphy; vif->wdev.iftype = type; - vif->sta_state = QTNF_STA_DISCONNECTED; break; default: pr_err("MAC%u: unsupported IF type %d\n", mac->macid, type); @@ -255,8 +255,6 @@ static struct wireless_dev *qtnf_add_virtual_intf(struct wiphy *wiphy, qtnf_cmd_send_del_intf(vif); err_cmd: vif->wdev.iftype = NL80211_IFTYPE_UNSPECIFIED; - eth_zero_addr(vif->mac_addr); - eth_zero_addr(vif->bssid); return ERR_PTR(-EFAULT); } diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.c b/drivers/net/wireless/quantenna/qtnfmac/core.c index b3bfb4faa918..3ccbc427cf56 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/core.c +++ b/drivers/net/wireless/quantenna/qtnfmac/core.c @@ -394,7 +394,6 @@ int qtnf_core_net_attach(struct qtnf_wmac *mac, struct qtnf_vif *vif, dev = alloc_netdev_mqs(sizeof(struct qtnf_vif *), name, name_assign_type, ether_setup, 1, 1); if (!dev) { - memset(&vif->wdev, 0, sizeof(vif->wdev)); vif->wdev.iftype = NL80211_IFTYPE_UNSPECIFIED; return -ENOMEM; }