From patchwork Thu Jun 27 08:44:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 808653 Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16]) (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 BA9A6131E41 for ; Thu, 27 Jun 2024 08:44:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.38.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719477864; cv=none; b=mQxS3HPJKBplVkpSWIWZqXzQg0r0KrUZ3NZmIYGxxXIIAPI7WHQZr0tfagYS0ElSGFTLrVMx507bu9oljK7kEUdObJww7YkoMWv1AY/HqxKf3dpavFRA61gWL4S9H+c3r59xqSPJQSPgGEDZN6RD2U/SEDa3TLO1HW7NNRwlhN4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719477864; c=relaxed/simple; bh=VPQUNJKhYdZNWTylpP+rrsxntMvpJZVHFNXTaH8RGf8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=duJJOJe1loiWAiHlT9Dwh4xxZtolM++4s+vKBgP2quKJEXvQE9S2hCivLy2WaUVeTCV/55aAljRnwLouzT+qHfaCsyDxU7+wtI+ZPLreliiuE3CxxoAU2Qk7OWW4ZMEgdwed/TveJQ4LwGl6/MwpTJaQ/KdDL2/TyiWDYZzxB+M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b=v8cI+uXx; arc=none smtp.client-ip=168.119.38.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="v8cI+uXx" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: Message-ID:Date:Subject:Cc:To:From:Content-Type:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-To:Resent-Cc: Resent-Message-ID:In-Reply-To:References; bh=tQWXCX8Y9t0oRias0uDtHTUSLKIMk4mys3zwUc3v+DY=; t=1719477861; x=1720687461; b=v8cI+uXxW+As0/LTIwBeYKPxfLBco8s/eBckqFZd3Hd47eExwV25AaXIYboSdEchhqSRHC1IWAk n7Sqh3O1MQzpfH773dgYzs2G4CLnz/xol3rFLkkT2WNseYxR50dqMYaYaZ0EQXKCOxnMXyqPpMSQD EfnpOCFnqeXzDphe5So1zp0ifKeH7mU5chHnnO7vR/7d42U7ZZoC//qu4k9IFp+ex4Lpn7BrrfzPr lWRtiUuXnuKnxskaPSoeStcZvt0cOR3y0nkmrvH1H9VhlVLHPTypNsZZz6zhr8CFrVTFy5aKCDVwR RhPfDtv8XBJuJ84XhkCDWZAWsb1akMj1AEKQ==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1sMkjq-00000006aek-39Iz; Thu, 27 Jun 2024 10:44:19 +0200 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Johannes Berg , Miriam Rachel Korenblit Subject: [PATCH 1/2] wifi: nl80211: don't give key data to userspace Date: Thu, 27 Jun 2024 10:44:11 +0200 Message-ID: <20240627104411.b6a4f097e4ea.I7e6cc976cb9e8a80ef25a3351330f313373b4578@changeid> X-Mailer: git-send-email 2.45.2 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Johannes Berg 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 Signed-off-by: Johannes Berg --- 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 72c7bf558581..63899fb2f316 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -4455,10 +4455,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 && @@ -4470,10 +4467,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 && From patchwork Thu Jun 27 08:44:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 808117 Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16]) (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 BBA49136653 for ; Thu, 27 Jun 2024 08:44:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.38.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719477864; cv=none; b=J9suJPaxf2JqXH6X1kBxU6zX5lncsAGgb16S3Xn6XKQtN9FXP03UNmS1bDHlvOH4ckAxLxRCi3JWC8x66S0miQDlTSU1x2rBTzUn9zlHo5evtrVun7kZDUCC7L6ZxnrIEe8g0bTQkoDtVleqCCzqJvM/BOQ1hdMQ8G8nRcz7JFI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719477864; c=relaxed/simple; bh=PrIoiPZrsJB7aBEjPG0lzg3q7jc1mx6M7DN/5lImNZk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HhTKQwMh0Hd+FjZhMArGZMZglIiSZ9jPkwoQZbS+iScJS8G3DGZ1dqYKCU7nfbi1CDia4mkHrWf53bL0J92MAJp4mibYxK3MKBPe2ndPVUAUcSDaOrlfLuPeHFsS6WLQ9QqGwNOPg0SnpKmLFi5YABidfYgku1xEe80nVYqnke0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b=eL+tXDZF; arc=none smtp.client-ip=168.119.38.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="eL+tXDZF" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Content-Type:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=ikYr4gQ//JRZHxrNESeTEtMxfRnYw/bFvpk018kJqmk=; t=1719477862; x=1720687462; b=eL+tXDZFCmIMTEUhF8q5Vlamk/svWdhb9v5QWGLhasqX7R4 xtu40rAptK1CI6b3b7dIeMJ/5+X2X5xrGX1sxR/yi1z2nLvRaIPA8q3EklssOKQU9b5vWRw6NBQP4 qBE7NuU4VKKzqZVyJl7WRznoPQlFseeMc+FBsUmHsKwjRVObkzukynoODdXlK/4wnSLjZrZJb/Pei qpRxJxDIMCflOfOKVwbPBQkZAY54F3b0NbOtGQTP9VpnOUlHUs9ZbveeWYUu/li9ZH62jnNg593lC Wjz/Uf+PrU2XwSf8trZK8bd4QBAqMv7eVi4EYso0UaYvK/IEduViycw0zpTWRcQQ==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1sMkjr-00000006aek-2dxO; Thu, 27 Jun 2024 10:44:19 +0200 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Johannes Berg , Miriam Rachel Korenblit Subject: [PATCH 2/2] wifi: mac80211: remove key data from get_key callback Date: Thu, 27 Jun 2024 10:44:12 +0200 Message-ID: <20240627104411.f8ac49a8cfe0.Ic01f775903f0acd10b9ba77eb39d4ed50e709173@changeid> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240627104411.b6a4f097e4ea.I7e6cc976cb9e8a80ef25a3351330f313373b4578@changeid> References: <20240627104411.b6a4f097e4ea.I7e6cc976cb9e8a80ef25a3351330f313373b4578@changeid> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Johannes Berg This is now unused in nl80211, so there's no need to set the pointer/length. Reviewed-by: Miriam Rachel Korenblit Signed-off-by: Johannes Berg --- net/mac80211/cfg.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 83ad6c9709fe..e77c7e7d5f56 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -742,9 +742,6 @@ static int ieee80211_get_key(struct wiphy *wiphy, struct net_device *dev, break; } - params.key = key->conf.key; - params.key_len = key->conf.keylen; - callback(cookie, ¶ms); err = 0;