Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp473839yba; Wed, 15 May 2019 04:46:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqwkzdTbQae33P7kw2sO5+dD5fKqcT+iK2Ha+hFberf/NC9B+v9TGmtiMIvEfhQoftk2GU7j X-Received: by 2002:a62:ed1a:: with SMTP id u26mr40036591pfh.229.1557920802316; Wed, 15 May 2019 04:46:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557920802; cv=none; d=google.com; s=arc-20160816; b=duNPHBOVuAM2u6G/wVYzurAGV5v2pe0AVebwqS5n4yo98UFabFoSqh7LcQeQjLIWie xsUJFYkIo3Iowe52MLj3nmQ2qb84AKV//RP2K7rW8VlY8JHk628pt7mZp/g8taMXlvFo qrW+QRfXMh4kfeygzca3gpKAdO5ymctyRTTqBM1p69OJV6bwHDC9rZ0qzPmuYE5E3/UW gqiOCBx1Z8y/nklhiI9EgkgAa7swsd+R0nEbdQwAeE94odXlYeLeyW4q/Khcj4udqdV8 HvWHdvx+sTKES4bfvSioRDj6np6QxyEuKFf7m/AHktaYcd7GV//DaOjusxydfDqF+Gbm rK6Q== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=z/lR8ZmEJij34NzaOXo+fgfHGxNLV+qmHbzzlP2N6jM=; b=ath81nUdITWMDXLTc3Eo0jiTLSMy74Hy0/4FZgFDr+X8gMFv0eXrzdv0TZBnMhJSs+ ZxhPf041UYQ8CCwZX3X3r+izPNxOTSf3V4V3v8fFldoRc872marsLE9vsO2B+vql4ywv RJV9T7rwPAT82olE5Jiab9usFT9DTc/V3BSQZQag64YsMCIxaBF1+wOIfmHDwNtgpGx0 kByhR1Wd9KTHQRMmDGHAWlDmdS2o7SjhCHDvFTWPG79UoPH1NmK1OC+szR4FxgIWk+i4 7xWP4wHP30DqQ7k496mZ6xT9tgd+AjR5AWZhkyCmaun4AgRGEfAH0anlS4W09/zYRWkg 0izw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JVA+x4vG; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q205si2007904pfc.151.2019.05.15.04.46.26; Wed, 15 May 2019 04:46:42 -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=JVA+x4vG; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730158AbfEOL0t (ORCPT + 99 others); Wed, 15 May 2019 07:26:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:37670 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729763AbfEOL0s (ORCPT ); Wed, 15 May 2019 07:26:48 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A77DC206BF; Wed, 15 May 2019 11:26:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557919607; bh=uOm5BvuEI4DDXppf2ixzVjQaw/JN4hbVR5wVHhA3v+M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JVA+x4vGXy9pT6+m1RHd31ZlWyda0hnTpxBDeuJSnOLUKSHUv5lSt0/Cj6WfzccDH t4LsKfuxozTLtSjREvmqsPR0YPcd5XkeL4XKqqlxKrigB/TFhX+dJQszfHi6nl0Nsh bScWfvc/ernyjSKbLypd9CeTb0z2sU4JVBAF+7uw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sunil Dutt , Johannes Berg , Sasha Levin Subject: [PATCH 5.0 025/137] nl80211: Add NL80211_FLAG_CLEAR_SKB flag for other NL commands Date: Wed, 15 May 2019 12:55:06 +0200 Message-Id: <20190515090655.104251473@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190515090651.633556783@linuxfoundation.org> References: <20190515090651.633556783@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ 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 d91a408db113e..156ce708b5330 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -13596,7 +13596,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, @@ -13647,7 +13648,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, @@ -13655,7 +13657,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, @@ -13684,7 +13687,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, @@ -14036,7 +14040,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, @@ -14091,7 +14096,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