* [PATCH AUTOSEL 5.10 01/20] xfrm: Check if_id in xfrm_migrate
@ 2022-03-09 16:21 Sasha Levin
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 02/20] xfrm: Fix xfrm migrate issues when address family changes Sasha Levin
` (8 more replies)
0 siblings, 9 replies; 11+ messages in thread
From: Sasha Levin @ 2022-03-09 16:21 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Yan Yan, Steffen Klassert, Sasha Levin, davem, kuba, netdev
From: Yan Yan <evitayan@google.com>
[ Upstream commit c1aca3080e382886e2e58e809787441984a2f89b ]
This patch enables distinguishing SAs and SPs based on if_id during
the xfrm_migrate flow. This ensures support for xfrm interfaces
throughout the SA/SP lifecycle.
When there are multiple existing SPs with the same direction,
the same xfrm_selector and different endpoint addresses,
xfrm_migrate might fail with ENODATA.
Specifically, the code path for performing xfrm_migrate is:
Stage 1: find policy to migrate with
xfrm_migrate_policy_find(sel, dir, type, net)
Stage 2: find and update state(s) with
xfrm_migrate_state_find(mp, net)
Stage 3: update endpoint address(es) of template(s) with
xfrm_policy_migrate(pol, m, num_migrate)
Currently "Stage 1" always returns the first xfrm_policy that
matches, and "Stage 3" looks for the xfrm_tmpl that matches the
old endpoint address. Thus if there are multiple xfrm_policy
with same selector, direction, type and net, "Stage 1" might
rertun a wrong xfrm_policy and "Stage 3" will fail with ENODATA
because it cannot find a xfrm_tmpl with the matching endpoint
address.
The fix is to allow userspace to pass an if_id and add if_id
to the matching rule in Stage 1 and Stage 2 since if_id is a
unique ID for xfrm_policy and xfrm_state. For compatibility,
if_id will only be checked if the attribute is set.
Tested with additions to Android's kernel unit test suite:
https://android-review.googlesource.com/c/kernel/tests/+/1668886
Signed-off-by: Yan Yan <evitayan@google.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/xfrm.h | 5 +++--
net/key/af_key.c | 2 +-
net/xfrm/xfrm_policy.c | 14 ++++++++------
net/xfrm/xfrm_state.c | 7 ++++++-
net/xfrm/xfrm_user.c | 6 +++++-
5 files changed, 23 insertions(+), 11 deletions(-)
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 4a2843441caf..0049a7459649 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1668,14 +1668,15 @@ int km_migrate(const struct xfrm_selector *sel, u8 dir, u8 type,
const struct xfrm_migrate *m, int num_bundles,
const struct xfrm_kmaddress *k,
const struct xfrm_encap_tmpl *encap);
-struct xfrm_state *xfrm_migrate_state_find(struct xfrm_migrate *m, struct net *net);
+struct xfrm_state *xfrm_migrate_state_find(struct xfrm_migrate *m, struct net *net,
+ u32 if_id);
struct xfrm_state *xfrm_state_migrate(struct xfrm_state *x,
struct xfrm_migrate *m,
struct xfrm_encap_tmpl *encap);
int xfrm_migrate(const struct xfrm_selector *sel, u8 dir, u8 type,
struct xfrm_migrate *m, int num_bundles,
struct xfrm_kmaddress *k, struct net *net,
- struct xfrm_encap_tmpl *encap);
+ struct xfrm_encap_tmpl *encap, u32 if_id);
#endif
int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport);
diff --git a/net/key/af_key.c b/net/key/af_key.c
index ef9b4ac03e7b..d1364b858fdf 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -2627,7 +2627,7 @@ static int pfkey_migrate(struct sock *sk, struct sk_buff *skb,
}
return xfrm_migrate(&sel, dir, XFRM_POLICY_TYPE_MAIN, m, i,
- kma ? &k : NULL, net, NULL);
+ kma ? &k : NULL, net, NULL, 0);
out:
return err;
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index c4a195cb3681..3d0ffd927004 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -4287,7 +4287,7 @@ static bool xfrm_migrate_selector_match(const struct xfrm_selector *sel_cmp,
}
static struct xfrm_policy *xfrm_migrate_policy_find(const struct xfrm_selector *sel,
- u8 dir, u8 type, struct net *net)
+ u8 dir, u8 type, struct net *net, u32 if_id)
{
struct xfrm_policy *pol, *ret = NULL;
struct hlist_head *chain;
@@ -4296,7 +4296,8 @@ static struct xfrm_policy *xfrm_migrate_policy_find(const struct xfrm_selector *
spin_lock_bh(&net->xfrm.xfrm_policy_lock);
chain = policy_hash_direct(net, &sel->daddr, &sel->saddr, sel->family, dir);
hlist_for_each_entry(pol, chain, bydst) {
- if (xfrm_migrate_selector_match(sel, &pol->selector) &&
+ if ((if_id == 0 || pol->if_id == if_id) &&
+ xfrm_migrate_selector_match(sel, &pol->selector) &&
pol->type == type) {
ret = pol;
priority = ret->priority;
@@ -4308,7 +4309,8 @@ static struct xfrm_policy *xfrm_migrate_policy_find(const struct xfrm_selector *
if ((pol->priority >= priority) && ret)
break;
- if (xfrm_migrate_selector_match(sel, &pol->selector) &&
+ if ((if_id == 0 || pol->if_id == if_id) &&
+ xfrm_migrate_selector_match(sel, &pol->selector) &&
pol->type == type) {
ret = pol;
break;
@@ -4424,7 +4426,7 @@ static int xfrm_migrate_check(const struct xfrm_migrate *m, int num_migrate)
int xfrm_migrate(const struct xfrm_selector *sel, u8 dir, u8 type,
struct xfrm_migrate *m, int num_migrate,
struct xfrm_kmaddress *k, struct net *net,
- struct xfrm_encap_tmpl *encap)
+ struct xfrm_encap_tmpl *encap, u32 if_id)
{
int i, err, nx_cur = 0, nx_new = 0;
struct xfrm_policy *pol = NULL;
@@ -4443,14 +4445,14 @@ int xfrm_migrate(const struct xfrm_selector *sel, u8 dir, u8 type,
}
/* Stage 1 - find policy */
- if ((pol = xfrm_migrate_policy_find(sel, dir, type, net)) == NULL) {
+ if ((pol = xfrm_migrate_policy_find(sel, dir, type, net, if_id)) == NULL) {
err = -ENOENT;
goto out;
}
/* Stage 2 - find and update state(s) */
for (i = 0, mp = m; i < num_migrate; i++, mp++) {
- if ((x = xfrm_migrate_state_find(mp, net))) {
+ if ((x = xfrm_migrate_state_find(mp, net, if_id))) {
x_cur[nx_cur] = x;
nx_cur++;
xc = xfrm_state_migrate(x, mp, encap);
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index f5b846a2edcd..37fe22b2e843 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -1569,7 +1569,8 @@ static struct xfrm_state *xfrm_state_clone(struct xfrm_state *orig,
return NULL;
}
-struct xfrm_state *xfrm_migrate_state_find(struct xfrm_migrate *m, struct net *net)
+struct xfrm_state *xfrm_migrate_state_find(struct xfrm_migrate *m, struct net *net,
+ u32 if_id)
{
unsigned int h;
struct xfrm_state *x = NULL;
@@ -1585,6 +1586,8 @@ struct xfrm_state *xfrm_migrate_state_find(struct xfrm_migrate *m, struct net *n
continue;
if (m->reqid && x->props.reqid != m->reqid)
continue;
+ if (if_id != 0 && x->if_id != if_id)
+ continue;
if (!xfrm_addr_equal(&x->id.daddr, &m->old_daddr,
m->old_family) ||
!xfrm_addr_equal(&x->props.saddr, &m->old_saddr,
@@ -1600,6 +1603,8 @@ struct xfrm_state *xfrm_migrate_state_find(struct xfrm_migrate *m, struct net *n
if (x->props.mode != m->mode ||
x->id.proto != m->proto)
continue;
+ if (if_id != 0 && x->if_id != if_id)
+ continue;
if (!xfrm_addr_equal(&x->id.daddr, &m->old_daddr,
m->old_family) ||
!xfrm_addr_equal(&x->props.saddr, &m->old_saddr,
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index d0fdfbf4c5f7..a535def86c52 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -2451,6 +2451,7 @@ static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh,
int n = 0;
struct net *net = sock_net(skb->sk);
struct xfrm_encap_tmpl *encap = NULL;
+ u32 if_id = 0;
if (attrs[XFRMA_MIGRATE] == NULL)
return -EINVAL;
@@ -2475,7 +2476,10 @@ static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh,
return 0;
}
- err = xfrm_migrate(&pi->sel, pi->dir, type, m, n, kmp, net, encap);
+ if (attrs[XFRMA_IF_ID])
+ if_id = nla_get_u32(attrs[XFRMA_IF_ID]);
+
+ err = xfrm_migrate(&pi->sel, pi->dir, type, m, n, kmp, net, encap, if_id);
kfree(encap);
--
2.34.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH AUTOSEL 5.10 02/20] xfrm: Fix xfrm migrate issues when address family changes
2022-03-09 16:21 [PATCH AUTOSEL 5.10 01/20] xfrm: Check if_id in xfrm_migrate Sasha Levin
@ 2022-03-09 16:21 ` Sasha Levin
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 08/20] mac80211: refuse aggregations sessions before authorized Sasha Levin
` (7 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: Sasha Levin @ 2022-03-09 16:21 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Yan Yan, Steffen Klassert, Sasha Levin, davem, kuba, netdev
From: Yan Yan <evitayan@google.com>
[ Upstream commit e03c3bba351f99ad932e8f06baa9da1afc418e02 ]
xfrm_migrate cannot handle address family change of an xfrm_state.
The symptons are the xfrm_state will be migrated to a wrong address,
and sending as well as receiving packets wil be broken.
This commit fixes it by breaking the original xfrm_state_clone
method into two steps so as to update the props.family before
running xfrm_init_state. As the result, xfrm_state's inner mode,
outer mode, type and IP header length in xfrm_state_migrate can
be updated with the new address family.
Tested with additions to Android's kernel unit test suite:
https://android-review.googlesource.com/c/kernel/tests/+/1885354
Signed-off-by: Yan Yan <evitayan@google.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/xfrm/xfrm_state.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 37fe22b2e843..1befc6db723b 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -1542,9 +1542,6 @@ static struct xfrm_state *xfrm_state_clone(struct xfrm_state *orig,
memcpy(&x->mark, &orig->mark, sizeof(x->mark));
memcpy(&x->props.smark, &orig->props.smark, sizeof(x->props.smark));
- if (xfrm_init_state(x) < 0)
- goto error;
-
x->props.flags = orig->props.flags;
x->props.extra_flags = orig->props.extra_flags;
@@ -1631,6 +1628,11 @@ struct xfrm_state *xfrm_state_migrate(struct xfrm_state *x,
if (!xc)
return NULL;
+ xc->props.family = m->new_family;
+
+ if (xfrm_init_state(xc) < 0)
+ goto error;
+
memcpy(&xc->id.daddr, &m->new_daddr, sizeof(xc->id.daddr));
memcpy(&xc->props.saddr, &m->new_saddr, sizeof(xc->props.saddr));
--
2.34.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH AUTOSEL 5.10 08/20] mac80211: refuse aggregations sessions before authorized
2022-03-09 16:21 [PATCH AUTOSEL 5.10 01/20] xfrm: Check if_id in xfrm_migrate Sasha Levin
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 02/20] xfrm: Fix xfrm migrate issues when address family changes Sasha Levin
@ 2022-03-09 16:21 ` Sasha Levin
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 11/20] can: rcar_canfd: rcar_canfd_channel_probe(): register the CAN device when fully ready Sasha Levin
` (6 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: Sasha Levin @ 2022-03-09 16:21 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Johannes Berg, Sasha Levin, johannes, davem, kuba, linux-wireless,
netdev
From: Johannes Berg <johannes.berg@intel.com>
[ Upstream commit a6bce78262f5dd4b50510f0aa47f3995f7b185f3 ]
If an MFP station isn't authorized, the receiver will (or
at least should) drop the action frame since it's a robust
management frame, but if we're not authorized we haven't
installed keys yet. Refuse attempts to start a session as
they'd just time out.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://lore.kernel.org/r/20220203201528.ff4d5679dce9.I34bb1f2bc341e161af2d6faf74f91b332ba11285@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/mac80211/agg-tx.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c
index 190f300d8923..4b4ab1961068 100644
--- a/net/mac80211/agg-tx.c
+++ b/net/mac80211/agg-tx.c
@@ -9,7 +9,7 @@
* Copyright 2007, Michael Wu <flamingice@sourmilk.net>
* Copyright 2007-2010, Intel Corporation
* Copyright(c) 2015-2017 Intel Deutschland GmbH
- * Copyright (C) 2018 - 2021 Intel Corporation
+ * Copyright (C) 2018 - 2022 Intel Corporation
*/
#include <linux/ieee80211.h>
@@ -626,6 +626,14 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid,
return -EINVAL;
}
+ if (test_sta_flag(sta, WLAN_STA_MFP) &&
+ !test_sta_flag(sta, WLAN_STA_AUTHORIZED)) {
+ ht_dbg(sdata,
+ "MFP STA not authorized - deny BA session request %pM tid %d\n",
+ sta->sta.addr, tid);
+ return -EINVAL;
+ }
+
/*
* 802.11n-2009 11.5.1.1: If the initiating STA is an HT STA, is a
* member of an IBSS, and has no other existing Block Ack agreement
--
2.34.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH AUTOSEL 5.10 11/20] can: rcar_canfd: rcar_canfd_channel_probe(): register the CAN device when fully ready
2022-03-09 16:21 [PATCH AUTOSEL 5.10 01/20] xfrm: Check if_id in xfrm_migrate Sasha Levin
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 02/20] xfrm: Fix xfrm migrate issues when address family changes Sasha Levin
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 08/20] mac80211: refuse aggregations sessions before authorized Sasha Levin
@ 2022-03-09 16:21 ` Sasha Levin
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 12/20] atm: firestream: check the return value of ioremap() in fs_init() Sasha Levin
` (5 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: Sasha Levin @ 2022-03-09 16:21 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Lad Prabhakar, Pavel Machek, Ulrich Hecht, Marc Kleine-Budde,
Sasha Levin, wg, davem, kuba, stefan.maetje, mailhol.vincent,
linux-can, netdev
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
[ Upstream commit c5048a7b2c23ab589f3476a783bd586b663eda5b ]
Register the CAN device only when all the necessary initialization is
completed. This patch makes sure all the data structures and locks are
initialized before registering the CAN device.
Link: https://lore.kernel.org/all/20220221225935.12300-1-prabhakar.mahadev-lad.rj@bp.renesas.com
Reported-by: Pavel Machek <pavel@denx.de>
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Pavel Machek <pavel@denx.de>
Reviewed-by: Ulrich Hecht <uli+renesas@fpond.eu>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/can/rcar/rcar_canfd.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/can/rcar/rcar_canfd.c b/drivers/net/can/rcar/rcar_canfd.c
index de59dd6aad29..67f0f14e2bf4 100644
--- a/drivers/net/can/rcar/rcar_canfd.c
+++ b/drivers/net/can/rcar/rcar_canfd.c
@@ -1598,15 +1598,15 @@ static int rcar_canfd_channel_probe(struct rcar_canfd_global *gpriv, u32 ch,
netif_napi_add(ndev, &priv->napi, rcar_canfd_rx_poll,
RCANFD_NAPI_WEIGHT);
+ spin_lock_init(&priv->tx_lock);
+ devm_can_led_init(ndev);
+ gpriv->ch[priv->channel] = priv;
err = register_candev(ndev);
if (err) {
dev_err(&pdev->dev,
"register_candev() failed, error %d\n", err);
goto fail_candev;
}
- spin_lock_init(&priv->tx_lock);
- devm_can_led_init(ndev);
- gpriv->ch[priv->channel] = priv;
dev_info(&pdev->dev, "device registered (channel %u)\n", priv->channel);
return 0;
--
2.34.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH AUTOSEL 5.10 12/20] atm: firestream: check the return value of ioremap() in fs_init()
2022-03-09 16:21 [PATCH AUTOSEL 5.10 01/20] xfrm: Check if_id in xfrm_migrate Sasha Levin
` (2 preceding siblings ...)
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 11/20] can: rcar_canfd: rcar_canfd_channel_probe(): register the CAN device when fully ready Sasha Levin
@ 2022-03-09 16:21 ` Sasha Levin
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 14/20] iwlwifi: don't advertise TWT support Sasha Levin
` (4 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: Sasha Levin @ 2022-03-09 16:21 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Jia-Ju Bai, TOTE Robot, David S . Miller, Sasha Levin, 3chas3,
linux-atm-general, netdev
From: Jia-Ju Bai <baijiaju1990@gmail.com>
[ Upstream commit d4e26aaea7f82ba884dcb4acfe689406bc092dc3 ]
The function ioremap() in fs_init() can fail, so its return value should
be checked.
Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/atm/firestream.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c
index 0ddd611b4277..43a34aee33b8 100644
--- a/drivers/atm/firestream.c
+++ b/drivers/atm/firestream.c
@@ -1675,6 +1675,8 @@ static int fs_init(struct fs_dev *dev)
dev->hw_base = pci_resource_start(pci_dev, 0);
dev->base = ioremap(dev->hw_base, 0x1000);
+ if (!dev->base)
+ return 1;
reset_chip (dev);
--
2.34.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH AUTOSEL 5.10 14/20] iwlwifi: don't advertise TWT support
2022-03-09 16:21 [PATCH AUTOSEL 5.10 01/20] xfrm: Check if_id in xfrm_migrate Sasha Levin
` (3 preceding siblings ...)
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 12/20] atm: firestream: check the return value of ioremap() in fs_init() Sasha Levin
@ 2022-03-09 16:21 ` Sasha Levin
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 16/20] nl80211: Update bss channel on channel switch for P2P_CLIENT Sasha Levin
` (3 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: Sasha Levin @ 2022-03-09 16:21 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Golan Ben Ami, Luca Coelho, Johannes Berg, Sasha Levin, kvalo,
davem, kuba, mordechay.goodstein, miriam.rachel.korenblit,
ilan.peer, linux-wireless, netdev
From: Golan Ben Ami <golan.ben.ami@intel.com>
[ Upstream commit 1db5fcbba2631277b78d7f8aff99c9607d29f6d8 ]
Some APs misbehave when TWT is used and cause our firmware to crash.
We don't know a reasonable way to detect and work around this problem
in the FW yet. To prevent these crashes, disable TWT in the driver by
stopping to advertise TWT support.
Link: https://bugzilla.kernel.org/show_bug.cgi?id=215523
Signed-off-by: Golan Ben Ami <golan.ben.ami@intel.com>
[reworded the commit message]
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/20220301072926.153969-1-luca@coelho.fi
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 3 +--
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 1 -
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
index cbde21e772b1..b862cfbcd6e7 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
@@ -587,8 +587,7 @@ static struct ieee80211_sband_iftype_data iwl_he_capa[] = {
.has_he = true,
.he_cap_elem = {
.mac_cap_info[0] =
- IEEE80211_HE_MAC_CAP0_HTC_HE |
- IEEE80211_HE_MAC_CAP0_TWT_REQ,
+ IEEE80211_HE_MAC_CAP0_HTC_HE,
.mac_cap_info[1] =
IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_16US |
IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_RX_QOS_8,
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index 922a7ea0cd24..d2c6fdb70273 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -350,7 +350,6 @@ static const u8 he_if_types_ext_capa_sta[] = {
[0] = WLAN_EXT_CAPA1_EXT_CHANNEL_SWITCHING,
[2] = WLAN_EXT_CAPA3_MULTI_BSSID_SUPPORT,
[7] = WLAN_EXT_CAPA8_OPMODE_NOTIF,
- [9] = WLAN_EXT_CAPA10_TWT_REQUESTER_SUPPORT,
};
static const struct wiphy_iftype_ext_capab he_iftypes_ext_capa[] = {
--
2.34.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH AUTOSEL 5.10 16/20] nl80211: Update bss channel on channel switch for P2P_CLIENT
2022-03-09 16:21 [PATCH AUTOSEL 5.10 01/20] xfrm: Check if_id in xfrm_migrate Sasha Levin
` (4 preceding siblings ...)
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 14/20] iwlwifi: don't advertise TWT support Sasha Levin
@ 2022-03-09 16:21 ` Sasha Levin
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 17/20] tcp: make tcp_read_sock() more robust Sasha Levin
` (2 subsequent siblings)
8 siblings, 0 replies; 11+ messages in thread
From: Sasha Levin @ 2022-03-09 16:21 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Sreeramya Soratkal, Johannes Berg, Sasha Levin, johannes, davem,
kuba, linux-wireless, netdev
From: Sreeramya Soratkal <quic_ssramya@quicinc.com>
[ Upstream commit e50b88c4f076242358b66ddb67482b96947438f2 ]
The wdev channel information is updated post channel switch only for
the station mode and not for the other modes. Due to this, the P2P client
still points to the old value though it moved to the new channel
when the channel change is induced from the P2P GO.
Update the bss channel after CSA channel switch completion for P2P client
interface as well.
Signed-off-by: Sreeramya Soratkal <quic_ssramya@quicinc.com>
Link: https://lore.kernel.org/r/1646114600-31479-1-git-send-email-quic_ssramya@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/wireless/nl80211.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 07bd7b00b56d..0df8b9a19952 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -17127,7 +17127,8 @@ void cfg80211_ch_switch_notify(struct net_device *dev,
wdev->chandef = *chandef;
wdev->preset_chandef = *chandef;
- if (wdev->iftype == NL80211_IFTYPE_STATION &&
+ if ((wdev->iftype == NL80211_IFTYPE_STATION ||
+ wdev->iftype == NL80211_IFTYPE_P2P_CLIENT) &&
!WARN_ON(!wdev->current_bss))
cfg80211_update_assoc_bss_entry(wdev, chandef->chan);
--
2.34.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH AUTOSEL 5.10 17/20] tcp: make tcp_read_sock() more robust
2022-03-09 16:21 [PATCH AUTOSEL 5.10 01/20] xfrm: Check if_id in xfrm_migrate Sasha Levin
` (5 preceding siblings ...)
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 16/20] nl80211: Update bss channel on channel switch for P2P_CLIENT Sasha Levin
@ 2022-03-09 16:21 ` Sasha Levin
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 18/20] sfc: extend the locking on mcdi->seqno Sasha Levin
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 19/20] bnx2: Fix an error message Sasha Levin
8 siblings, 0 replies; 11+ messages in thread
From: Sasha Levin @ 2022-03-09 16:21 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Eric Dumazet, John Fastabend, Jakub Sitnicki, Daniel Borkmann,
Jakub Kicinski, Sasha Levin, davem, yoshfuji, dsahern, netdev
From: Eric Dumazet <edumazet@google.com>
[ Upstream commit e3d5ea2c011ecb16fb94c56a659364e6b30fac94 ]
If recv_actor() returns an incorrect value, tcp_read_sock()
might loop forever.
Instead, issue a one time warning and make sure to make progress.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Acked-by: Jakub Sitnicki <jakub@cloudflare.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/r/20220302161723.3910001-2-eric.dumazet@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv4/tcp.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 63c81af41b43..a3ec2a08027b 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1652,11 +1652,13 @@ int tcp_read_sock(struct sock *sk, read_descriptor_t *desc,
if (!copied)
copied = used;
break;
- } else if (used <= len) {
- seq += used;
- copied += used;
- offset += used;
}
+ if (WARN_ON_ONCE(used > len))
+ used = len;
+ seq += used;
+ copied += used;
+ offset += used;
+
/* If recv_actor drops the lock (e.g. TCP splice
* receive) the skb pointer might be invalid when
* getting here: tcp_collapse might have deleted it
--
2.34.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH AUTOSEL 5.10 18/20] sfc: extend the locking on mcdi->seqno
2022-03-09 16:21 [PATCH AUTOSEL 5.10 01/20] xfrm: Check if_id in xfrm_migrate Sasha Levin
` (6 preceding siblings ...)
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 17/20] tcp: make tcp_read_sock() more robust Sasha Levin
@ 2022-03-09 16:21 ` Sasha Levin
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 19/20] bnx2: Fix an error message Sasha Levin
8 siblings, 0 replies; 11+ messages in thread
From: Sasha Levin @ 2022-03-09 16:21 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Niels Dossche, Martin Habets, David S . Miller, Sasha Levin,
ecree.xilinx, kuba, netdev
From: Niels Dossche <dossche.niels@gmail.com>
[ Upstream commit f1fb205efb0ccca55626fd4ef38570dd16b44719 ]
seqno could be read as a stale value outside of the lock. The lock is
already acquired to protect the modification of seqno against a possible
race condition. Place the reading of this value also inside this locking
to protect it against a possible race condition.
Signed-off-by: Niels Dossche <dossche.niels@gmail.com>
Acked-by: Martin Habets <habetsm.xilinx@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/sfc/mcdi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/sfc/mcdi.c b/drivers/net/ethernet/sfc/mcdi.c
index be6bfd6b7ec7..50baf62b2cbc 100644
--- a/drivers/net/ethernet/sfc/mcdi.c
+++ b/drivers/net/ethernet/sfc/mcdi.c
@@ -163,9 +163,9 @@ static void efx_mcdi_send_request(struct efx_nic *efx, unsigned cmd,
/* Serialise with efx_mcdi_ev_cpl() and efx_mcdi_ev_death() */
spin_lock_bh(&mcdi->iface_lock);
++mcdi->seqno;
+ seqno = mcdi->seqno & SEQ_MASK;
spin_unlock_bh(&mcdi->iface_lock);
- seqno = mcdi->seqno & SEQ_MASK;
xflags = 0;
if (mcdi->mode == MCDI_MODE_EVENTS)
xflags |= MCDI_HEADER_XFLAGS_EVREQ;
--
2.34.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH AUTOSEL 5.10 19/20] bnx2: Fix an error message
2022-03-09 16:21 [PATCH AUTOSEL 5.10 01/20] xfrm: Check if_id in xfrm_migrate Sasha Levin
` (7 preceding siblings ...)
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 18/20] sfc: extend the locking on mcdi->seqno Sasha Levin
@ 2022-03-09 16:21 ` Sasha Levin
2022-03-17 11:23 ` Pavel Machek
8 siblings, 1 reply; 11+ messages in thread
From: Sasha Levin @ 2022-03-09 16:21 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Christophe JAILLET, David S . Miller, Sasha Levin, rmody,
GR-Linux-NIC-Dev, kuba, netdev
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
[ Upstream commit 8ccffe9ac3239e549beaa0a9d5e1a1eac94e866c ]
Fix an error message and report the correct failing function.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/broadcom/bnx2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2.c b/drivers/net/ethernet/broadcom/bnx2.c
index 633b10389653..93129d9a87f4 100644
--- a/drivers/net/ethernet/broadcom/bnx2.c
+++ b/drivers/net/ethernet/broadcom/bnx2.c
@@ -8229,7 +8229,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
rc = pci_set_consistent_dma_mask(pdev, persist_dma_mask);
if (rc) {
dev_err(&pdev->dev,
- "pci_set_consistent_dma_mask failed, aborting\n");
+ "dma_set_coherent_mask failed, aborting\n");
goto err_out_unmap;
}
} else if ((rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) != 0) {
--
2.34.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH AUTOSEL 5.10 19/20] bnx2: Fix an error message
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 19/20] bnx2: Fix an error message Sasha Levin
@ 2022-03-17 11:23 ` Pavel Machek
0 siblings, 0 replies; 11+ messages in thread
From: Pavel Machek @ 2022-03-17 11:23 UTC (permalink / raw)
To: Sasha Levin, Greg KH
Cc: linux-kernel, stable, Christophe JAILLET, David S . Miller, rmody,
GR-Linux-NIC-Dev, kuba, netdev
[-- Attachment #1: Type: text/plain, Size: 1154 bytes --]
Hi!
> From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>
> [ Upstream commit 8ccffe9ac3239e549beaa0a9d5e1a1eac94e866c ]
>
> Fix an error message and report the correct failing function.
This patch is not really fixing an important bug, it is just tweaking
an error message. I'm not sure why it is being queued for stable. I
believe AUTOSEL process should be more careful.
Second, at least for 5.10 and older, it is not _fixing_ bug, it is
_adding_ one, as old message is correct there.
Please drop.
Pavel
> +++ b/drivers/net/ethernet/broadcom/bnx2.c
> @@ -8229,7 +8229,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
> rc = pci_set_consistent_dma_mask(pdev, persist_dma_mask);
> if (rc) {
> dev_err(&pdev->dev,
> - "pci_set_consistent_dma_mask failed, aborting\n");
> + "dma_set_coherent_mask failed, aborting\n");
> goto err_out_unmap;
> }
> } else if ((rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) != 0) {
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2022-03-17 11:23 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-09 16:21 [PATCH AUTOSEL 5.10 01/20] xfrm: Check if_id in xfrm_migrate Sasha Levin
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 02/20] xfrm: Fix xfrm migrate issues when address family changes Sasha Levin
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 08/20] mac80211: refuse aggregations sessions before authorized Sasha Levin
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 11/20] can: rcar_canfd: rcar_canfd_channel_probe(): register the CAN device when fully ready Sasha Levin
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 12/20] atm: firestream: check the return value of ioremap() in fs_init() Sasha Levin
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 14/20] iwlwifi: don't advertise TWT support Sasha Levin
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 16/20] nl80211: Update bss channel on channel switch for P2P_CLIENT Sasha Levin
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 17/20] tcp: make tcp_read_sock() more robust Sasha Levin
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 18/20] sfc: extend the locking on mcdi->seqno Sasha Levin
2022-03-09 16:21 ` [PATCH AUTOSEL 5.10 19/20] bnx2: Fix an error message Sasha Levin
2022-03-17 11:23 ` Pavel Machek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).