]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/linux/linux-5.15-wifi-security-patches-9.patch
backup(.pl): Replace OpenVPN DH parameter with ffdhe4096
[people/pmueller/ipfire-2.x.git] / src / patches / linux / linux-5.15-wifi-security-patches-9.patch
1 From 864f2d3482f4bd0c62b355e35ee8300be8ef488e Mon Sep 17 00:00:00 2001
2 From: Johannes Berg <johannes.berg@intel.com>
3 Date: Thu, 13 Oct 2022 20:15:56 +0200
4 Subject: [PATCH] mac80211: mesh: clean up rx_bcn_presp API
5
6 commit a5b983c6073140b624f64e79fea6d33c3e4315a0 upstream.
7
8 We currently pass the entire elements to the rx_bcn_presp()
9 method, but only need mesh_config. Additionally, we use the
10 length of the elements to calculate back the entire frame's
11 length, but that's confusing - just pass the length of the
12 frame instead.
13
14 Link: https://lore.kernel.org/r/20210920154009.a18ed3d2da6c.I1824b773a0fbae4453e1433c184678ca14e8df45@changeid
15 Signed-off-by: Johannes Berg <johannes.berg@intel.com>
16 Cc: Felix Fietkau <nbd@nbd.name>
17 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
18 ---
19 net/mac80211/ieee80211_i.h | 7 +++----
20 net/mac80211/mesh.c | 4 ++--
21 net/mac80211/mesh_sync.c | 26 ++++++++++++--------------
22 3 files changed, 17 insertions(+), 20 deletions(-)
23
24 diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
25 index f7bea4af2ddb..4bd55af184b2 100644
26 --- a/net/mac80211/ieee80211_i.h
27 +++ b/net/mac80211/ieee80211_i.h
28 @@ -631,10 +631,9 @@ struct ieee80211_if_ocb {
29 */
30 struct ieee802_11_elems;
31 struct ieee80211_mesh_sync_ops {
32 - void (*rx_bcn_presp)(struct ieee80211_sub_if_data *sdata,
33 - u16 stype,
34 - struct ieee80211_mgmt *mgmt,
35 - struct ieee802_11_elems *elems,
36 + void (*rx_bcn_presp)(struct ieee80211_sub_if_data *sdata, u16 stype,
37 + struct ieee80211_mgmt *mgmt, unsigned int len,
38 + const struct ieee80211_meshconf_ie *mesh_cfg,
39 struct ieee80211_rx_status *rx_status);
40
41 /* should be called with beacon_data under RCU read lock */
42 diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
43 index 42bd81a30310..9f6414a68d71 100644
44 --- a/net/mac80211/mesh.c
45 +++ b/net/mac80211/mesh.c
46 @@ -1354,8 +1354,8 @@ static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,
47 }
48
49 if (ifmsh->sync_ops)
50 - ifmsh->sync_ops->rx_bcn_presp(sdata,
51 - stype, mgmt, &elems, rx_status);
52 + ifmsh->sync_ops->rx_bcn_presp(sdata, stype, mgmt, len,
53 + elems.mesh_config, rx_status);
54 }
55
56 int ieee80211_mesh_finish_csa(struct ieee80211_sub_if_data *sdata)
57 diff --git a/net/mac80211/mesh_sync.c b/net/mac80211/mesh_sync.c
58 index fde93de2b80a..9e342cc2504c 100644
59 --- a/net/mac80211/mesh_sync.c
60 +++ b/net/mac80211/mesh_sync.c
61 @@ -3,6 +3,7 @@
62 * Copyright 2011-2012, Pavel Zubarev <pavel.zubarev@gmail.com>
63 * Copyright 2011-2012, Marco Porsch <marco.porsch@s2005.tu-chemnitz.de>
64 * Copyright 2011-2012, cozybit Inc.
65 + * Copyright (C) 2021 Intel Corporation
66 */
67
68 #include "ieee80211_i.h"
69 @@ -35,12 +36,12 @@ struct sync_method {
70 /**
71 * mesh_peer_tbtt_adjusting - check if an mp is currently adjusting its TBTT
72 *
73 - * @ie: information elements of a management frame from the mesh peer
74 + * @cfg: mesh config element from the mesh peer (or %NULL)
75 */
76 -static bool mesh_peer_tbtt_adjusting(struct ieee802_11_elems *ie)
77 +static bool mesh_peer_tbtt_adjusting(const struct ieee80211_meshconf_ie *cfg)
78 {
79 - return (ie->mesh_config->meshconf_cap &
80 - IEEE80211_MESHCONF_CAPAB_TBTT_ADJUSTING) != 0;
81 + return cfg &&
82 + (cfg->meshconf_cap & IEEE80211_MESHCONF_CAPAB_TBTT_ADJUSTING);
83 }
84
85 void mesh_sync_adjust_tsf(struct ieee80211_sub_if_data *sdata)
86 @@ -76,11 +77,11 @@ void mesh_sync_adjust_tsf(struct ieee80211_sub_if_data *sdata)
87 }
88 }
89
90 -static void mesh_sync_offset_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,
91 - u16 stype,
92 - struct ieee80211_mgmt *mgmt,
93 - struct ieee802_11_elems *elems,
94 - struct ieee80211_rx_status *rx_status)
95 +static void
96 +mesh_sync_offset_rx_bcn_presp(struct ieee80211_sub_if_data *sdata, u16 stype,
97 + struct ieee80211_mgmt *mgmt, unsigned int len,
98 + const struct ieee80211_meshconf_ie *mesh_cfg,
99 + struct ieee80211_rx_status *rx_status)
100 {
101 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
102 struct ieee80211_local *local = sdata->local;
103 @@ -101,10 +102,7 @@ static void mesh_sync_offset_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,
104 */
105 if (ieee80211_have_rx_timestamp(rx_status))
106 t_r = ieee80211_calculate_rx_timestamp(local, rx_status,
107 - 24 + 12 +
108 - elems->total_len +
109 - FCS_LEN,
110 - 24);
111 + len + FCS_LEN, 24);
112 else
113 t_r = drv_get_tsf(local, sdata);
114
115 @@ -119,7 +117,7 @@ static void mesh_sync_offset_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,
116 * dot11MeshNbrOffsetMaxNeighbor non-peer non-MBSS neighbors
117 */
118
119 - if (elems->mesh_config && mesh_peer_tbtt_adjusting(elems)) {
120 + if (mesh_peer_tbtt_adjusting(mesh_cfg)) {
121 msync_dbg(sdata, "STA %pM : is adjusting TBTT\n",
122 sta->sta.addr);
123 goto no_sync;
124 --
125 2.30.2
126