]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: nl80211: don't give key data to userspace
authorJohannes Berg <johannes.berg@intel.com>
Thu, 27 Jun 2024 08:44:11 +0000 (10:44 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Aug 2024 13:34:10 +0000 (15:34 +0200)
[ 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 <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20240627104411.b6a4f097e4ea.I7e6cc976cb9e8a80ef25a3351330f313373b4578@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/wireless/nl80211.c

index 07538be6805ef5425d1c57615cae0f620d82b209..c2829d673bc76aa4b03032fb6595a78b260c4d85 100644 (file)
@@ -4485,10 +4485,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 &&
@@ -4500,10 +4497,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 &&