+++ /dev/null
-From 6f8b363a885f8db2c0169d89b186f28a7ab88f6e Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 7 Jun 2021 23:02:59 +0800
-Subject: net: moxa: Use devm_platform_get_and_ioremap_resource()
-
-From: Yang Yingliang <yangyingliang@huawei.com>
-
-[ Upstream commit 35cba15a504bf4f585bb9d78f47b22b28a1a06b2 ]
-
-Use devm_platform_get_and_ioremap_resource() to simplify
-code and avoid a null-ptr-deref by checking 'res' in it.
-
-Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/net/ethernet/moxa/moxart_ether.c | 5 ++---
- 1 file changed, 2 insertions(+), 3 deletions(-)
-
-diff --git a/drivers/net/ethernet/moxa/moxart_ether.c b/drivers/net/ethernet/moxa/moxart_ether.c
-index beb730ff5d42..794f1702e54c 100644
---- a/drivers/net/ethernet/moxa/moxart_ether.c
-+++ b/drivers/net/ethernet/moxa/moxart_ether.c
-@@ -477,14 +477,13 @@ static int moxart_mac_probe(struct platform_device *pdev)
- priv = netdev_priv(ndev);
- priv->ndev = ndev;
-
-- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-- ndev->base_addr = res->start;
-- priv->base = devm_ioremap_resource(p_dev, res);
-+ priv->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
- if (IS_ERR(priv->base)) {
- dev_err(p_dev, "devm_ioremap_resource failed\n");
- ret = PTR_ERR(priv->base);
- goto init_fail;
- }
-+ ndev->base_addr = res->start;
-
- spin_lock_init(&priv->txlock);
-
---
-2.30.2
-
virtio_net-remove-bug-to-avoid-machine-dead.patch
net-bcmgenet-check-return-value-after-calling-platfo.patch
net-micrel-check-return-value-after-calling-platform.patch
-net-moxa-use-devm_platform_get_and_ioremap_resource.patch
fjes-check-return-value-after-calling-platform_get_r.patch
selinux-use-__gfp_nowarn-with-gfp_nowait-in-the-avc.patch
xfrm-fix-error-reporting-in-xfrm_state_construct.patch
+++ /dev/null
-From 0429310d30cb53c898762db8e0735b611eb3c8cd Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 7 Jun 2021 23:02:59 +0800
-Subject: net: moxa: Use devm_platform_get_and_ioremap_resource()
-
-From: Yang Yingliang <yangyingliang@huawei.com>
-
-[ Upstream commit 35cba15a504bf4f585bb9d78f47b22b28a1a06b2 ]
-
-Use devm_platform_get_and_ioremap_resource() to simplify
-code and avoid a null-ptr-deref by checking 'res' in it.
-
-Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/net/ethernet/moxa/moxart_ether.c | 5 ++---
- 1 file changed, 2 insertions(+), 3 deletions(-)
-
-diff --git a/drivers/net/ethernet/moxa/moxart_ether.c b/drivers/net/ethernet/moxa/moxart_ether.c
-index 4db3431b79ac..223019a74033 100644
---- a/drivers/net/ethernet/moxa/moxart_ether.c
-+++ b/drivers/net/ethernet/moxa/moxart_ether.c
-@@ -477,14 +477,13 @@ static int moxart_mac_probe(struct platform_device *pdev)
- priv = netdev_priv(ndev);
- priv->ndev = ndev;
-
-- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-- ndev->base_addr = res->start;
-- priv->base = devm_ioremap_resource(p_dev, res);
-+ priv->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
- if (IS_ERR(priv->base)) {
- dev_err(p_dev, "devm_ioremap_resource failed\n");
- ret = PTR_ERR(priv->base);
- goto init_fail;
- }
-+ ndev->base_addr = res->start;
-
- spin_lock_init(&priv->txlock);
-
---
-2.30.2
-
net-bcmgenet-check-return-value-after-calling-platfo.patch
net-mvpp2-check-return-value-after-calling-platform_.patch
net-micrel-check-return-value-after-calling-platform.patch
-net-moxa-use-devm_platform_get_and_ioremap_resource.patch
fjes-check-return-value-after-calling-platform_get_r.patch
selinux-use-__gfp_nowarn-with-gfp_nowait-in-the-avc.patch
xfrm-fix-error-reporting-in-xfrm_state_construct.patch
+++ /dev/null
-From 6e05f36367a2588ec603dd5c8591c48e7ce20334 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 7 Jun 2021 23:02:59 +0800
-Subject: net: moxa: Use devm_platform_get_and_ioremap_resource()
-
-From: Yang Yingliang <yangyingliang@huawei.com>
-
-[ Upstream commit 35cba15a504bf4f585bb9d78f47b22b28a1a06b2 ]
-
-Use devm_platform_get_and_ioremap_resource() to simplify
-code and avoid a null-ptr-deref by checking 'res' in it.
-
-Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/net/ethernet/moxa/moxart_ether.c | 5 ++---
- 1 file changed, 2 insertions(+), 3 deletions(-)
-
-diff --git a/drivers/net/ethernet/moxa/moxart_ether.c b/drivers/net/ethernet/moxa/moxart_ether.c
-index 374e691b11da..ed3c5d2d7e0e 100644
---- a/drivers/net/ethernet/moxa/moxart_ether.c
-+++ b/drivers/net/ethernet/moxa/moxart_ether.c
-@@ -457,14 +457,13 @@ static int moxart_mac_probe(struct platform_device *pdev)
- priv = netdev_priv(ndev);
- priv->ndev = ndev;
-
-- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-- ndev->base_addr = res->start;
-- priv->base = devm_ioremap_resource(p_dev, res);
-+ priv->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
- if (IS_ERR(priv->base)) {
- dev_err(p_dev, "devm_ioremap_resource failed\n");
- ret = PTR_ERR(priv->base);
- goto init_fail;
- }
-+ ndev->base_addr = res->start;
-
- spin_lock_init(&priv->txlock);
-
---
-2.30.2
-
rdma-cxgb4-fix-missing-error-code-in-create_qp.patch
dm-space-maps-don-t-reset-space-map-allocation-curso.patch
net-micrel-check-return-value-after-calling-platform.patch
-net-moxa-use-devm_platform_get_and_ioremap_resource.patch
selinux-use-__gfp_nowarn-with-gfp_nowait-in-the-avc.patch
xfrm-fix-error-reporting-in-xfrm_state_construct.patch
wlcore-wl12xx-fix-wl12xx-get_mac-error-if-device-is-.patch
+++ /dev/null
-From cd8f4d5f36e62966eb94ad2bb0d594848f775e61 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 7 Jun 2021 23:02:59 +0800
-Subject: net: moxa: Use devm_platform_get_and_ioremap_resource()
-
-From: Yang Yingliang <yangyingliang@huawei.com>
-
-[ Upstream commit 35cba15a504bf4f585bb9d78f47b22b28a1a06b2 ]
-
-Use devm_platform_get_and_ioremap_resource() to simplify
-code and avoid a null-ptr-deref by checking 'res' in it.
-
-Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/net/ethernet/moxa/moxart_ether.c | 5 ++---
- 1 file changed, 2 insertions(+), 3 deletions(-)
-
-diff --git a/drivers/net/ethernet/moxa/moxart_ether.c b/drivers/net/ethernet/moxa/moxart_ether.c
-index 6fe61d9343cb..9673fbe16774 100644
---- a/drivers/net/ethernet/moxa/moxart_ether.c
-+++ b/drivers/net/ethernet/moxa/moxart_ether.c
-@@ -487,14 +487,13 @@ static int moxart_mac_probe(struct platform_device *pdev)
- priv = netdev_priv(ndev);
- priv->ndev = ndev;
-
-- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-- ndev->base_addr = res->start;
-- priv->base = devm_ioremap_resource(p_dev, res);
-+ priv->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
- if (IS_ERR(priv->base)) {
- dev_err(p_dev, "devm_ioremap_resource failed\n");
- ret = PTR_ERR(priv->base);
- goto init_fail;
- }
-+ ndev->base_addr = res->start;
-
- spin_lock_init(&priv->txlock);
-
---
-2.30.2
-
rdma-cxgb4-fix-missing-error-code-in-create_qp.patch
dm-space-maps-don-t-reset-space-map-allocation-curso.patch
net-micrel-check-return-value-after-calling-platform.patch
-net-moxa-use-devm_platform_get_and_ioremap_resource.patch
fjes-check-return-value-after-calling-platform_get_r.patch
selinux-use-__gfp_nowarn-with-gfp_nowait-in-the-avc.patch
xfrm-fix-error-reporting-in-xfrm_state_construct.patch
i40e-fix-ptp-on-5gb-links.patch
qemu_fw_cfg-make-fw_cfg_rev_attr-a-proper-kobj_attribute.patch
ipmi-watchdog-stop-watchdog-timer-when-the-current-action-is-none.patch
-xfrm-policy-read-seqcount-outside-of-rcu-read-side-in-xfrm_policy_lookup_bytype.patch
thermal-drivers-int340x-processor_thermal-fix-tcc-setting.patch
ubifs-fix-races-between-xattr_-set-get-and-listxattr-operations.patch
power-supply-ab8500-fix-an-old-bug.patch
+++ /dev/null
-From d7b0408934c749f546b01f2b33d07421a49b6f3e Mon Sep 17 00:00:00 2001
-From: Varad Gautam <varad.gautam@suse.com>
-Date: Fri, 28 May 2021 18:04:06 +0200
-Subject: xfrm: policy: Read seqcount outside of rcu-read side in xfrm_policy_lookup_bytype
-
-From: Varad Gautam <varad.gautam@suse.com>
-
-commit d7b0408934c749f546b01f2b33d07421a49b6f3e upstream.
-
-xfrm_policy_lookup_bytype loops on seqcount mutex xfrm_policy_hash_generation
-within an RCU read side critical section. Although ill advised, this is fine if
-the loop is bounded.
-
-xfrm_policy_hash_generation wraps mutex hash_resize_mutex, which is used to
-serialize writers (xfrm_hash_resize, xfrm_hash_rebuild). This is fine too.
-
-On PREEMPT_RT=y, the read_seqcount_begin call within xfrm_policy_lookup_bytype
-emits a mutex lock/unlock for hash_resize_mutex. Mutex locking is fine, since
-RCU read side critical sections are allowed to sleep with PREEMPT_RT.
-
-xfrm_hash_resize can, however, block on synchronize_rcu while holding
-hash_resize_mutex.
-
-This leads to the following situation on PREEMPT_RT, where the writer is
-blocked on RCU grace period expiry, while the reader is blocked on a lock held
-by the writer:
-
-Thead 1 (xfrm_hash_resize) Thread 2 (xfrm_policy_lookup_bytype)
-
- rcu_read_lock();
-mutex_lock(&hash_resize_mutex);
- read_seqcount_begin(&xfrm_policy_hash_generation);
- mutex_lock(&hash_resize_mutex); // block
-xfrm_bydst_resize();
-synchronize_rcu(); // block
- <RCU stalls in xfrm_policy_lookup_bytype>
-
-Move the read_seqcount_begin call outside of the RCU read side critical section,
-and do an rcu_read_unlock/retry if we got stale data within the critical section.
-
-On non-PREEMPT_RT, this shortens the time spent within RCU read side critical
-section in case the seqcount needs a retry, and avoids unbounded looping.
-
-Fixes: 77cc278f7b20 ("xfrm: policy: Use sequence counters with associated lock")
-Signed-off-by: Varad Gautam <varad.gautam@suse.com>
-Cc: linux-rt-users <linux-rt-users@vger.kernel.org>
-Cc: netdev@vger.kernel.org
-Cc: stable@vger.kernel.org # v4.9
-Cc: Steffen Klassert <steffen.klassert@secunet.com>
-Cc: Herbert Xu <herbert@gondor.apana.org.au>
-Cc: "David S. Miller" <davem@davemloft.net>
-Cc: Jakub Kicinski <kuba@kernel.org>
-Cc: Florian Westphal <fw@strlen.de>
-Cc: "Ahmed S. Darwish" <a.darwish@linutronix.de>
-Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
-Acked-by: Ahmed S. Darwish <a.darwish@linutronix.de>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
----
- net/xfrm/xfrm_policy.c | 21 ++++++++++++++-------
- 1 file changed, 14 insertions(+), 7 deletions(-)
-
---- a/net/xfrm/xfrm_policy.c
-+++ b/net/xfrm/xfrm_policy.c
-@@ -2092,12 +2092,15 @@ static struct xfrm_policy *xfrm_policy_l
- if (unlikely(!daddr || !saddr))
- return NULL;
-
-- rcu_read_lock();
- retry:
-- do {
-- sequence = read_seqcount_begin(&xfrm_policy_hash_generation);
-- chain = policy_hash_direct(net, daddr, saddr, family, dir);
-- } while (read_seqcount_retry(&xfrm_policy_hash_generation, sequence));
-+ sequence = read_seqcount_begin(&xfrm_policy_hash_generation);
-+ rcu_read_lock();
-+
-+ chain = policy_hash_direct(net, daddr, saddr, family, dir);
-+ if (read_seqcount_retry(&xfrm_policy_hash_generation, sequence)) {
-+ rcu_read_unlock();
-+ goto retry;
-+ }
-
- ret = NULL;
- hlist_for_each_entry_rcu(pol, chain, bydst) {
-@@ -2128,11 +2131,15 @@ static struct xfrm_policy *xfrm_policy_l
- }
-
- skip_inexact:
-- if (read_seqcount_retry(&xfrm_policy_hash_generation, sequence))
-+ if (read_seqcount_retry(&xfrm_policy_hash_generation, sequence)) {
-+ rcu_read_unlock();
- goto retry;
-+ }
-
-- if (ret && !xfrm_pol_hold_rcu(ret))
-+ if (ret && !xfrm_pol_hold_rcu(ret)) {
-+ rcu_read_unlock();
- goto retry;
-+ }
- fail:
- rcu_read_unlock();
-
i40e-fix-ptp-on-5gb-links.patch
qemu_fw_cfg-make-fw_cfg_rev_attr-a-proper-kobj_attribute.patch
ipmi-watchdog-stop-watchdog-timer-when-the-current-action-is-none.patch
-xfrm-policy-read-seqcount-outside-of-rcu-read-side-in-xfrm_policy_lookup_bytype.patch
thermal-drivers-int340x-processor_thermal-fix-tcc-setting.patch
ubifs-fix-races-between-xattr_-set-get-and-listxattr-operations.patch
power-supply-ab8500-fix-an-old-bug.patch
+++ /dev/null
-From d7b0408934c749f546b01f2b33d07421a49b6f3e Mon Sep 17 00:00:00 2001
-From: Varad Gautam <varad.gautam@suse.com>
-Date: Fri, 28 May 2021 18:04:06 +0200
-Subject: xfrm: policy: Read seqcount outside of rcu-read side in xfrm_policy_lookup_bytype
-
-From: Varad Gautam <varad.gautam@suse.com>
-
-commit d7b0408934c749f546b01f2b33d07421a49b6f3e upstream.
-
-xfrm_policy_lookup_bytype loops on seqcount mutex xfrm_policy_hash_generation
-within an RCU read side critical section. Although ill advised, this is fine if
-the loop is bounded.
-
-xfrm_policy_hash_generation wraps mutex hash_resize_mutex, which is used to
-serialize writers (xfrm_hash_resize, xfrm_hash_rebuild). This is fine too.
-
-On PREEMPT_RT=y, the read_seqcount_begin call within xfrm_policy_lookup_bytype
-emits a mutex lock/unlock for hash_resize_mutex. Mutex locking is fine, since
-RCU read side critical sections are allowed to sleep with PREEMPT_RT.
-
-xfrm_hash_resize can, however, block on synchronize_rcu while holding
-hash_resize_mutex.
-
-This leads to the following situation on PREEMPT_RT, where the writer is
-blocked on RCU grace period expiry, while the reader is blocked on a lock held
-by the writer:
-
-Thead 1 (xfrm_hash_resize) Thread 2 (xfrm_policy_lookup_bytype)
-
- rcu_read_lock();
-mutex_lock(&hash_resize_mutex);
- read_seqcount_begin(&xfrm_policy_hash_generation);
- mutex_lock(&hash_resize_mutex); // block
-xfrm_bydst_resize();
-synchronize_rcu(); // block
- <RCU stalls in xfrm_policy_lookup_bytype>
-
-Move the read_seqcount_begin call outside of the RCU read side critical section,
-and do an rcu_read_unlock/retry if we got stale data within the critical section.
-
-On non-PREEMPT_RT, this shortens the time spent within RCU read side critical
-section in case the seqcount needs a retry, and avoids unbounded looping.
-
-Fixes: 77cc278f7b20 ("xfrm: policy: Use sequence counters with associated lock")
-Signed-off-by: Varad Gautam <varad.gautam@suse.com>
-Cc: linux-rt-users <linux-rt-users@vger.kernel.org>
-Cc: netdev@vger.kernel.org
-Cc: stable@vger.kernel.org # v4.9
-Cc: Steffen Klassert <steffen.klassert@secunet.com>
-Cc: Herbert Xu <herbert@gondor.apana.org.au>
-Cc: "David S. Miller" <davem@davemloft.net>
-Cc: Jakub Kicinski <kuba@kernel.org>
-Cc: Florian Westphal <fw@strlen.de>
-Cc: "Ahmed S. Darwish" <a.darwish@linutronix.de>
-Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
-Acked-by: Ahmed S. Darwish <a.darwish@linutronix.de>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
----
- net/xfrm/xfrm_policy.c | 21 ++++++++++++++-------
- 1 file changed, 14 insertions(+), 7 deletions(-)
-
---- a/net/xfrm/xfrm_policy.c
-+++ b/net/xfrm/xfrm_policy.c
-@@ -2092,12 +2092,15 @@ static struct xfrm_policy *xfrm_policy_l
- if (unlikely(!daddr || !saddr))
- return NULL;
-
-- rcu_read_lock();
- retry:
-- do {
-- sequence = read_seqcount_begin(&xfrm_policy_hash_generation);
-- chain = policy_hash_direct(net, daddr, saddr, family, dir);
-- } while (read_seqcount_retry(&xfrm_policy_hash_generation, sequence));
-+ sequence = read_seqcount_begin(&xfrm_policy_hash_generation);
-+ rcu_read_lock();
-+
-+ chain = policy_hash_direct(net, daddr, saddr, family, dir);
-+ if (read_seqcount_retry(&xfrm_policy_hash_generation, sequence)) {
-+ rcu_read_unlock();
-+ goto retry;
-+ }
-
- ret = NULL;
- hlist_for_each_entry_rcu(pol, chain, bydst) {
-@@ -2128,11 +2131,15 @@ static struct xfrm_policy *xfrm_policy_l
- }
-
- skip_inexact:
-- if (read_seqcount_retry(&xfrm_policy_hash_generation, sequence))
-+ if (read_seqcount_retry(&xfrm_policy_hash_generation, sequence)) {
-+ rcu_read_unlock();
- goto retry;
-+ }
-
-- if (ret && !xfrm_pol_hold_rcu(ret))
-+ if (ret && !xfrm_pol_hold_rcu(ret)) {
-+ rcu_read_unlock();
- goto retry;
-+ }
- fail:
- rcu_read_unlock();
-
i40e-fix-ptp-on-5gb-links.patch
qemu_fw_cfg-make-fw_cfg_rev_attr-a-proper-kobj_attribute.patch
ipmi-watchdog-stop-watchdog-timer-when-the-current-action-is-none.patch
-xfrm-policy-read-seqcount-outside-of-rcu-read-side-in-xfrm_policy_lookup_bytype.patch
thermal-drivers-int340x-processor_thermal-fix-tcc-setting.patch
ubifs-fix-races-between-xattr_-set-get-and-listxattr-operations.patch
power-supply-ab8500-fix-an-old-bug.patch
+++ /dev/null
-From d7b0408934c749f546b01f2b33d07421a49b6f3e Mon Sep 17 00:00:00 2001
-From: Varad Gautam <varad.gautam@suse.com>
-Date: Fri, 28 May 2021 18:04:06 +0200
-Subject: xfrm: policy: Read seqcount outside of rcu-read side in xfrm_policy_lookup_bytype
-
-From: Varad Gautam <varad.gautam@suse.com>
-
-commit d7b0408934c749f546b01f2b33d07421a49b6f3e upstream.
-
-xfrm_policy_lookup_bytype loops on seqcount mutex xfrm_policy_hash_generation
-within an RCU read side critical section. Although ill advised, this is fine if
-the loop is bounded.
-
-xfrm_policy_hash_generation wraps mutex hash_resize_mutex, which is used to
-serialize writers (xfrm_hash_resize, xfrm_hash_rebuild). This is fine too.
-
-On PREEMPT_RT=y, the read_seqcount_begin call within xfrm_policy_lookup_bytype
-emits a mutex lock/unlock for hash_resize_mutex. Mutex locking is fine, since
-RCU read side critical sections are allowed to sleep with PREEMPT_RT.
-
-xfrm_hash_resize can, however, block on synchronize_rcu while holding
-hash_resize_mutex.
-
-This leads to the following situation on PREEMPT_RT, where the writer is
-blocked on RCU grace period expiry, while the reader is blocked on a lock held
-by the writer:
-
-Thead 1 (xfrm_hash_resize) Thread 2 (xfrm_policy_lookup_bytype)
-
- rcu_read_lock();
-mutex_lock(&hash_resize_mutex);
- read_seqcount_begin(&xfrm_policy_hash_generation);
- mutex_lock(&hash_resize_mutex); // block
-xfrm_bydst_resize();
-synchronize_rcu(); // block
- <RCU stalls in xfrm_policy_lookup_bytype>
-
-Move the read_seqcount_begin call outside of the RCU read side critical section,
-and do an rcu_read_unlock/retry if we got stale data within the critical section.
-
-On non-PREEMPT_RT, this shortens the time spent within RCU read side critical
-section in case the seqcount needs a retry, and avoids unbounded looping.
-
-Fixes: 77cc278f7b20 ("xfrm: policy: Use sequence counters with associated lock")
-Signed-off-by: Varad Gautam <varad.gautam@suse.com>
-Cc: linux-rt-users <linux-rt-users@vger.kernel.org>
-Cc: netdev@vger.kernel.org
-Cc: stable@vger.kernel.org # v4.9
-Cc: Steffen Klassert <steffen.klassert@secunet.com>
-Cc: Herbert Xu <herbert@gondor.apana.org.au>
-Cc: "David S. Miller" <davem@davemloft.net>
-Cc: Jakub Kicinski <kuba@kernel.org>
-Cc: Florian Westphal <fw@strlen.de>
-Cc: "Ahmed S. Darwish" <a.darwish@linutronix.de>
-Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
-Acked-by: Ahmed S. Darwish <a.darwish@linutronix.de>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
----
- net/xfrm/xfrm_policy.c | 21 ++++++++++++++-------
- 1 file changed, 14 insertions(+), 7 deletions(-)
-
---- a/net/xfrm/xfrm_policy.c
-+++ b/net/xfrm/xfrm_policy.c
-@@ -2092,12 +2092,15 @@ static struct xfrm_policy *xfrm_policy_l
- if (unlikely(!daddr || !saddr))
- return NULL;
-
-- rcu_read_lock();
- retry:
-- do {
-- sequence = read_seqcount_begin(&xfrm_policy_hash_generation);
-- chain = policy_hash_direct(net, daddr, saddr, family, dir);
-- } while (read_seqcount_retry(&xfrm_policy_hash_generation, sequence));
-+ sequence = read_seqcount_begin(&xfrm_policy_hash_generation);
-+ rcu_read_lock();
-+
-+ chain = policy_hash_direct(net, daddr, saddr, family, dir);
-+ if (read_seqcount_retry(&xfrm_policy_hash_generation, sequence)) {
-+ rcu_read_unlock();
-+ goto retry;
-+ }
-
- ret = NULL;
- hlist_for_each_entry_rcu(pol, chain, bydst) {
-@@ -2128,11 +2131,15 @@ static struct xfrm_policy *xfrm_policy_l
- }
-
- skip_inexact:
-- if (read_seqcount_retry(&xfrm_policy_hash_generation, sequence))
-+ if (read_seqcount_retry(&xfrm_policy_hash_generation, sequence)) {
-+ rcu_read_unlock();
- goto retry;
-+ }
-
-- if (ret && !xfrm_pol_hold_rcu(ret))
-+ if (ret && !xfrm_pol_hold_rcu(ret)) {
-+ rcu_read_unlock();
- goto retry;
-+ }
- fail:
- rcu_read_unlock();
-
+++ /dev/null
-From ae8621da378ce782ab29674d14a413c64fbd4bce Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 7 Jun 2021 23:02:59 +0800
-Subject: net: moxa: Use devm_platform_get_and_ioremap_resource()
-
-From: Yang Yingliang <yangyingliang@huawei.com>
-
-[ Upstream commit 35cba15a504bf4f585bb9d78f47b22b28a1a06b2 ]
-
-Use devm_platform_get_and_ioremap_resource() to simplify
-code and avoid a null-ptr-deref by checking 'res' in it.
-
-Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/net/ethernet/moxa/moxart_ether.c | 5 ++---
- 1 file changed, 2 insertions(+), 3 deletions(-)
-
-diff --git a/drivers/net/ethernet/moxa/moxart_ether.c b/drivers/net/ethernet/moxa/moxart_ether.c
-index f70bb81e1ed6..9f7eaae51335 100644
---- a/drivers/net/ethernet/moxa/moxart_ether.c
-+++ b/drivers/net/ethernet/moxa/moxart_ether.c
-@@ -480,14 +480,13 @@ static int moxart_mac_probe(struct platform_device *pdev)
- priv->ndev = ndev;
- priv->pdev = pdev;
-
-- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-- ndev->base_addr = res->start;
-- priv->base = devm_ioremap_resource(p_dev, res);
-+ priv->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
- if (IS_ERR(priv->base)) {
- dev_err(p_dev, "devm_ioremap_resource failed\n");
- ret = PTR_ERR(priv->base);
- goto init_fail;
- }
-+ ndev->base_addr = res->start;
-
- spin_lock_init(&priv->txlock);
-
---
-2.30.2
-
net-bcmgenet-check-return-value-after-calling-platfo.patch
net-mvpp2-check-return-value-after-calling-platform_.patch
net-micrel-check-return-value-after-calling-platform.patch
-net-moxa-use-devm_platform_get_and_ioremap_resource.patch
drm-amd-display-update-scaling-settings-on-modeset.patch
drm-amd-display-release-mst-resources-on-switch-from.patch
drm-amd-display-set-dispclk_max_errdet_cycles-to-7.patch
asoc-tegra-set-driver_name-tegra-for-all-machine-drivers.patch
qemu_fw_cfg-make-fw_cfg_rev_attr-a-proper-kobj_attribute.patch
ipmi-watchdog-stop-watchdog-timer-when-the-current-action-is-none.patch
-xfrm-policy-read-seqcount-outside-of-rcu-read-side-in-xfrm_policy_lookup_bytype.patch
thermal-drivers-int340x-processor_thermal-fix-tcc-setting.patch
ubifs-fix-races-between-xattr_-set-get-and-listxattr-operations.patch
power-supply-ab8500-fix-an-old-bug.patch
+++ /dev/null
-From d7b0408934c749f546b01f2b33d07421a49b6f3e Mon Sep 17 00:00:00 2001
-From: Varad Gautam <varad.gautam@suse.com>
-Date: Fri, 28 May 2021 18:04:06 +0200
-Subject: xfrm: policy: Read seqcount outside of rcu-read side in xfrm_policy_lookup_bytype
-
-From: Varad Gautam <varad.gautam@suse.com>
-
-commit d7b0408934c749f546b01f2b33d07421a49b6f3e upstream.
-
-xfrm_policy_lookup_bytype loops on seqcount mutex xfrm_policy_hash_generation
-within an RCU read side critical section. Although ill advised, this is fine if
-the loop is bounded.
-
-xfrm_policy_hash_generation wraps mutex hash_resize_mutex, which is used to
-serialize writers (xfrm_hash_resize, xfrm_hash_rebuild). This is fine too.
-
-On PREEMPT_RT=y, the read_seqcount_begin call within xfrm_policy_lookup_bytype
-emits a mutex lock/unlock for hash_resize_mutex. Mutex locking is fine, since
-RCU read side critical sections are allowed to sleep with PREEMPT_RT.
-
-xfrm_hash_resize can, however, block on synchronize_rcu while holding
-hash_resize_mutex.
-
-This leads to the following situation on PREEMPT_RT, where the writer is
-blocked on RCU grace period expiry, while the reader is blocked on a lock held
-by the writer:
-
-Thead 1 (xfrm_hash_resize) Thread 2 (xfrm_policy_lookup_bytype)
-
- rcu_read_lock();
-mutex_lock(&hash_resize_mutex);
- read_seqcount_begin(&xfrm_policy_hash_generation);
- mutex_lock(&hash_resize_mutex); // block
-xfrm_bydst_resize();
-synchronize_rcu(); // block
- <RCU stalls in xfrm_policy_lookup_bytype>
-
-Move the read_seqcount_begin call outside of the RCU read side critical section,
-and do an rcu_read_unlock/retry if we got stale data within the critical section.
-
-On non-PREEMPT_RT, this shortens the time spent within RCU read side critical
-section in case the seqcount needs a retry, and avoids unbounded looping.
-
-Fixes: 77cc278f7b20 ("xfrm: policy: Use sequence counters with associated lock")
-Signed-off-by: Varad Gautam <varad.gautam@suse.com>
-Cc: linux-rt-users <linux-rt-users@vger.kernel.org>
-Cc: netdev@vger.kernel.org
-Cc: stable@vger.kernel.org # v4.9
-Cc: Steffen Klassert <steffen.klassert@secunet.com>
-Cc: Herbert Xu <herbert@gondor.apana.org.au>
-Cc: "David S. Miller" <davem@davemloft.net>
-Cc: Jakub Kicinski <kuba@kernel.org>
-Cc: Florian Westphal <fw@strlen.de>
-Cc: "Ahmed S. Darwish" <a.darwish@linutronix.de>
-Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
-Acked-by: Ahmed S. Darwish <a.darwish@linutronix.de>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- net/xfrm/xfrm_policy.c | 21 ++++++++++++++-------
- 1 file changed, 14 insertions(+), 7 deletions(-)
-
---- a/net/xfrm/xfrm_policy.c
-+++ b/net/xfrm/xfrm_policy.c
-@@ -2089,12 +2089,15 @@ static struct xfrm_policy *xfrm_policy_l
- if (unlikely(!daddr || !saddr))
- return NULL;
-
-- rcu_read_lock();
- retry:
-- do {
-- sequence = read_seqcount_begin(&xfrm_policy_hash_generation);
-- chain = policy_hash_direct(net, daddr, saddr, family, dir);
-- } while (read_seqcount_retry(&xfrm_policy_hash_generation, sequence));
-+ sequence = read_seqcount_begin(&xfrm_policy_hash_generation);
-+ rcu_read_lock();
-+
-+ chain = policy_hash_direct(net, daddr, saddr, family, dir);
-+ if (read_seqcount_retry(&xfrm_policy_hash_generation, sequence)) {
-+ rcu_read_unlock();
-+ goto retry;
-+ }
-
- ret = NULL;
- hlist_for_each_entry_rcu(pol, chain, bydst) {
-@@ -2125,11 +2128,15 @@ static struct xfrm_policy *xfrm_policy_l
- }
-
- skip_inexact:
-- if (read_seqcount_retry(&xfrm_policy_hash_generation, sequence))
-+ if (read_seqcount_retry(&xfrm_policy_hash_generation, sequence)) {
-+ rcu_read_unlock();
- goto retry;
-+ }
-
-- if (ret && !xfrm_pol_hold_rcu(ret))
-+ if (ret && !xfrm_pol_hold_rcu(ret)) {
-+ rcu_read_unlock();
- goto retry;
-+ }
- fail:
- rcu_read_unlock();
-