Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3334484yba; Mon, 6 May 2019 22:41:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqyKRouhof6TV97YgiPZxnmT5zDxtLp2TiS9yWG9FH13fB1omIUkcxionOyWFGg0dvqoAb7t X-Received: by 2002:a17:902:854c:: with SMTP id d12mr38013513plo.150.1557207669379; Mon, 06 May 2019 22:41:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557207669; cv=none; d=google.com; s=arc-20160816; b=cyuD0q5xf2RBCxk5IyVoXb+fKmFgV049P03HvgLGs0T6N2tK6C8fi3KfcQDGU3vxZo cvdHGY0fbdGwEK4FzU8xyK0aLm2Rexj5ucpogU0SEgG+kyDRvIFpq2a2HynRpGwrOro/ Nm8qw/DtG0VbMcCxvJ8L7kRaLLQlUYkHEQU0relsSQwPSpLLnv7odED+WCxa6C66W39v h5ZuBKnUSEJHzfRXunJkbyuL8ZQDy9jdAKQcLKzfZpINb0B54lpnhr9Ll0A6GDrS1++S KLd/6ftq8LXaZU8qLE1zadiCxDfN43dDvPLOh64wBZ1BzBbYAzMW3zwAarFFH9bBu1Nb iv/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=TpDKJAFSAaOWNq4kNzXZuElqvJGQUiPlCZ1tsOrxo0g=; b=Z2mkexj5n4NhI7G9j4ZId8cyly9G1q2gtmP8ueE7fQLA3eEpFAPOE52xnWqcnuIP8j m0c/4hYBHHyULkzHyTRyz9Oiob/mM31gCkyO4bpecnf6gp0IAweKdjCdp+FE2z5/+77h R5d+k8weLpW8h08+9UdL41gaRd4k+WxmMWMtMPxD9P92uSsKsdu4N2Lvo/ihaxwHiY2i /b2RHVJYVUIXchd6mgFQ0QRtOGhOMEMVzsj+d4ZmFd4vNNC0/vDA5qlr0gPX46bfKWKA yicQODBfwbBqf6t6Hn4AjHVZbBKXxCmb1LFcE4frf/YMuEkGxD60gU/tDT3InDX7YNF8 6KIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="ecZH/Q+U"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t21si17792961pgm.438.2019.05.06.22.40.53; Mon, 06 May 2019 22:41:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="ecZH/Q+U"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728742AbfEGFim (ORCPT + 99 others); Tue, 7 May 2019 01:38:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:58432 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728714AbfEGFik (ORCPT ); Tue, 7 May 2019 01:38:40 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AE300206A3; Tue, 7 May 2019 05:38:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557207519; bh=TFdJyvUjJpEhPvCZZANtbgOwSBX7ybxA106rFtdE+g0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ecZH/Q+UBk0Gbyg73RUtbmAHr+bY9yLGke3sTegzHeCCJ3omx/yE2NkxhvoCeByC7 T2Q2DAKmZMh6nTtYVK/g+m0fc+iqAQWTUwcCddAtUhCFhxRIqP8I0Mm3njv958QkL5 EKeOjIVjIeB4N//+7heksEhgjanDhBXUW7MBYhSQ= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Sunil Dutt , Johannes Berg , Sasha Levin , linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.14 11/95] nl80211: Add NL80211_FLAG_CLEAR_SKB flag for other NL commands Date: Tue, 7 May 2019 01:37:00 -0400 Message-Id: <20190507053826.31622-11-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190507053826.31622-1-sashal@kernel.org> References: <20190507053826.31622-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sunil Dutt [ Upstream commit d6db02a88a4aaa1cd7105137c67ddec7f3bdbc05 ] This commit adds NL80211_FLAG_CLEAR_SKB flag to other NL commands that carry key data to ensure they do not stick around on heap after the SKB is freed. Also introduced this flag for NL80211_CMD_VENDOR as there are sub commands which configure the keys. Signed-off-by: Sunil Dutt Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/wireless/nl80211.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 46e9812d13c0..c1a2ad050e61 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -12761,7 +12761,8 @@ static const struct genl_ops nl80211_ops[] = { .policy = nl80211_policy, .flags = GENL_UNS_ADMIN_PERM, .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | - NL80211_FLAG_NEED_RTNL, + NL80211_FLAG_NEED_RTNL | + NL80211_FLAG_CLEAR_SKB, }, { .cmd = NL80211_CMD_DEAUTHENTICATE, @@ -12812,7 +12813,8 @@ static const struct genl_ops nl80211_ops[] = { .policy = nl80211_policy, .flags = GENL_UNS_ADMIN_PERM, .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | - NL80211_FLAG_NEED_RTNL, + NL80211_FLAG_NEED_RTNL | + NL80211_FLAG_CLEAR_SKB, }, { .cmd = NL80211_CMD_UPDATE_CONNECT_PARAMS, @@ -12820,7 +12822,8 @@ static const struct genl_ops nl80211_ops[] = { .policy = nl80211_policy, .flags = GENL_ADMIN_PERM, .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | - NL80211_FLAG_NEED_RTNL, + NL80211_FLAG_NEED_RTNL | + NL80211_FLAG_CLEAR_SKB, }, { .cmd = NL80211_CMD_DISCONNECT, @@ -12849,7 +12852,8 @@ static const struct genl_ops nl80211_ops[] = { .policy = nl80211_policy, .flags = GENL_UNS_ADMIN_PERM, .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | - NL80211_FLAG_NEED_RTNL, + NL80211_FLAG_NEED_RTNL | + NL80211_FLAG_CLEAR_SKB, }, { .cmd = NL80211_CMD_DEL_PMKSA, @@ -13201,7 +13205,8 @@ static const struct genl_ops nl80211_ops[] = { .policy = nl80211_policy, .flags = GENL_UNS_ADMIN_PERM, .internal_flags = NL80211_FLAG_NEED_WIPHY | - NL80211_FLAG_NEED_RTNL, + NL80211_FLAG_NEED_RTNL | + NL80211_FLAG_CLEAR_SKB, }, { .cmd = NL80211_CMD_SET_QOS_MAP, @@ -13256,7 +13261,8 @@ static const struct genl_ops nl80211_ops[] = { .doit = nl80211_set_pmk, .policy = nl80211_policy, .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | - NL80211_FLAG_NEED_RTNL, + NL80211_FLAG_NEED_RTNL | + NL80211_FLAG_CLEAR_SKB, }, { .cmd = NL80211_CMD_DEL_PMK, -- 2.20.1