Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp455222yba; Wed, 15 May 2019 04:24:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqx9kiBVOQQf5j+1i//3WT8c+quWiv73rdiFP61PHH3+xRADfDpjxbdlMem/3ZGDMG5DGMrb X-Received: by 2002:a17:902:2aeb:: with SMTP id j98mr10214458plb.135.1557919470523; Wed, 15 May 2019 04:24:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557919470; cv=none; d=google.com; s=arc-20160816; b=uOEyKecACDTx5AyyvjpuOjyJaknZREpW4rakyMYMnr0MJdEzr+PZ43ie0iMPxFPIgf NwEYUKE04E578bH7pFRVefBormAPrzJbP+Z/To46r3TlRIhAIDjqXhsjDpqQJJGkg8ZU fbNHKm5PXcTmJ1qLtpLpik3If0fLyBzxS3/LtsVrsewzLaod6IlB2LPAnMFeILhBUF4v KPG4W83fjRuOqMPk9Fe23a2POJDByg3YkNrEWWOy4sF+7ElEX5Kn80Sh3wdI7ub8cuCt AJQq43WmIoYcXMOVMw6xX/eehD4l/L5WnLjl6AEKzbJnPY8tM1gxlkEERa1LipGjM+OJ SVwQ== 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=KFMwrbMG0GyClPygPSJiHXKRjEc+SJa0r151PNmqCKA=; b=MlEGbmZNf2jUmr+gk+M8WySkZhKo9SiLet0GNsDKV4LUuy5QUY8GgaNS4EKnQgin+E lpQOkJe36wD4xj9KNgvxXPcGDbLxMrhzvj+rTpSkr43iGQWJqhBKQEJ/FuxXrwvYoFXx B0+m4EHhuuj8T7l1S04SU03A3Vzv+UNo9Azi6OK77LprpT+CCykcX5nPuZ32AAKA1k/E 86QlzvYB0GuNoit6eCKv68wZfgyVfI++FdcXElH6Jl0Okk6/Nuh4cZoMQZWpBE5+1wM3 eoMjw5xtPf8Cg+r3u7If0OwkcB/15j939ZXV8K9/Jluxt4y0b6hOVmD3FZc5EdVSUE8s 8fvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iLk8yo86; 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 f1si1554029pgo.517.2019.05.15.04.24.15; Wed, 15 May 2019 04:24:30 -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=iLk8yo86; 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 S1731337AbfEOLVo (ORCPT + 99 others); Wed, 15 May 2019 07:21:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:59660 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731331AbfEOLVm (ORCPT ); Wed, 15 May 2019 07:21:42 -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 00A0E20818; Wed, 15 May 2019 11:21:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557919301; bh=kjJVS+8XxdE6bWNKF25v4fMqxNityECM0bk9SW1LRFk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iLk8yo86jgoSe3v8/hOoldsAamA++LOtlAYD6cCHeRCP5RWIVTlF2z/EqFTnH6Vn5 iz4s5d2KPTKnBzFGPdbt7nJ6Au4EAmbCCF0wdI5jICLOUtCZOcjTmZLworRnqtEljv TF/PWY8SDhQo+n4P1cloJq06/0LEYYPUGCFKL+xA= 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 4.19 023/113] nl80211: Add NL80211_FLAG_CLEAR_SKB flag for other NL commands Date: Wed, 15 May 2019 12:55:14 +0200 Message-Id: <20190515090655.241690094@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190515090652.640988966@linuxfoundation.org> References: <20190515090652.640988966@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 295cd8d5554f6..048e004ed0ee8 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -13392,7 +13392,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, @@ -13443,7 +13444,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, @@ -13451,7 +13453,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, @@ -13480,7 +13483,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, @@ -13832,7 +13836,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, @@ -13887,7 +13892,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