Skip to content

Commit 5241526

Browse files
committed
wifi: mac80211: don't send keys to driver when fips_enabled
When fips_enabled is set, don't send any keys to the driver (including possibly WoWLAN KEK/KCK material), assuming that no device exists with the necessary certifications. If this turns out to be false in the future, we can add a HW flag. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Miri Korenblit <[email protected]> Link: https://patch.msgid.link/20250709233537.e5eebc2b19d8.I968ef8c9ffb48d464ada78685bd25d22349fb063@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent 14450be commit 5241526

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

net/mac80211/driver-ops.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: GPL-2.0-only
22
/*
33
* Copyright 2015 Intel Deutschland GmbH
4-
* Copyright (C) 2022-2024 Intel Corporation
4+
* Copyright (C) 2022-2025 Intel Corporation
55
*/
66
#include <net/mac80211.h>
77
#include "ieee80211_i.h"
@@ -515,6 +515,9 @@ int drv_set_key(struct ieee80211_local *local,
515515
!(sdata->vif.active_links & BIT(key->link_id))))
516516
return -ENOLINK;
517517

518+
if (fips_enabled)
519+
return -EOPNOTSUPP;
520+
518521
trace_drv_set_key(local, cmd, sdata, sta, key);
519522
ret = local->ops->set_key(&local->hw, cmd, &sdata->vif, sta, key);
520523
trace_drv_return_int(local, ret);

net/mac80211/driver-ops.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#ifndef __MAC80211_DRIVER_OPS
99
#define __MAC80211_DRIVER_OPS
1010

11+
#include <linux/fips.h>
1112
#include <net/mac80211.h>
1213
#include "ieee80211_i.h"
1314
#include "trace.h"
@@ -902,6 +903,9 @@ static inline void drv_set_rekey_data(struct ieee80211_local *local,
902903
if (!check_sdata_in_driver(sdata))
903904
return;
904905

906+
if (fips_enabled)
907+
return;
908+
905909
trace_drv_set_rekey_data(local, sdata, data);
906910
if (local->ops->set_rekey_data)
907911
local->ops->set_rekey_data(&local->hw, &sdata->vif, data);

0 commit comments

Comments
 (0)