From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B823718D639; Thu, 15 Aug 2024 13:34:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723728883; cv=none; b=sRmIc+wIHOJq0rO/x0V++Z8FGeC+4GPDgDBWZVs68gKv9NcymXjYYHkoZW63tzM9qPWPc5A3LHQQO2CJu0aaLJ8LdcXetlXQivMq2XNLDhqBbj3gnj8mwmWSODY6KmMqA+dD7gj/pX7os2ibHCW1qzIUgVnWMYZSw1sUffmoAR8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723728883; c=relaxed/simple; bh=l/tOq+8Vk38S2lvad4KYhTSn55QWvaaEVZsAGzv/UnE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=n/gBZ3g6ZWY7VNcvC5YtDPBmDgFj8rAQKWNTW7EWIF7dAO6jLCaP1P1ZBijqJwbsm/ej29RurnwlIVXH/ILu6Zon3/kBLB6DWhwTGpMgOqUrVPRf6M7z9us7CDyFA52Lho36LoUDIrRysJrsjMMKbvT3cGJj7Twjlgx4MwY4PxI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=mQ20On63; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="mQ20On63" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CF815C32786; Thu, 15 Aug 2024 13:34:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1723728883; bh=l/tOq+8Vk38S2lvad4KYhTSn55QWvaaEVZsAGzv/UnE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mQ20On63pRRlnu4D2dWlekYUPpP+M9pp0OVEvCmzlWFkkjJ4SGZGd5IvJFEBFsJjU ydmLPPDPpNXATR0G3953UbK0381FkTmVEC5LXQYEXo1vSm7Nvt4lSffsezRh6LkGay rsbKGYP38CD0Javmfd4vDx4v841m4aDqD+p8qvJk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Miriam Rachel Korenblit , Johannes Berg , Sasha Levin Subject: [PATCH 4.19 139/196] wifi: nl80211: dont give key data to userspace Date: Thu, 15 Aug 2024 15:24:16 +0200 Message-ID: <20240815131857.392772968@linuxfoundation.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240815131852.063866671@linuxfoundation.org> References: <20240815131852.063866671@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Johannes Berg [ Upstream commit a7e5793035792cc46a1a4b0a783655ffa897dfe9 ] When a key is requested by userspace, there's really no need to include the key data, the sequence counter is really what userspace needs in this case. The fact that it's included is just a historic quirk. Remove the key data. Reviewed-by: Miriam Rachel Korenblit Link: https://patch.msgid.link/20240627104411.b6a4f097e4ea.I7e6cc976cb9e8a80ef25a3351330f313373b4578@changeid Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/wireless/nl80211.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 15f28203445cb..ebd8449f2fcf1 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -3383,10 +3383,7 @@ static void get_key_callback(void *c, struct key_params *params) struct nlattr *key; struct get_key_cookie *cookie = c; - if ((params->key && - nla_put(cookie->msg, NL80211_ATTR_KEY_DATA, - params->key_len, params->key)) || - (params->seq && + if ((params->seq && nla_put(cookie->msg, NL80211_ATTR_KEY_SEQ, params->seq_len, params->seq)) || (params->cipher && @@ -3398,10 +3395,7 @@ static void get_key_callback(void *c, struct key_params *params) if (!key) goto nla_put_failure; - if ((params->key && - nla_put(cookie->msg, NL80211_KEY_DATA, - params->key_len, params->key)) || - (params->seq && + if ((params->seq && nla_put(cookie->msg, NL80211_KEY_SEQ, params->seq_len, params->seq)) || (params->cipher && -- 2.43.0