From: Greg Kroah-Hartman Date: Fri, 16 Jul 2021 17:58:17 +0000 (+0200) Subject: drop some patches X-Git-Tag: v5.4.133~5 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=f539fb2ac82db1cd36e263e25044528757049d95;p=thirdparty%2Fkernel%2Fstable-queue.git drop some patches --- diff --git a/queue-4.14/net-moxa-use-devm_platform_get_and_ioremap_resource.patch b/queue-4.14/net-moxa-use-devm_platform_get_and_ioremap_resource.patch deleted file mode 100644 index 1bfda2ba107..00000000000 --- a/queue-4.14/net-moxa-use-devm_platform_get_and_ioremap_resource.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 6f8b363a885f8db2c0169d89b186f28a7ab88f6e Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Mon, 7 Jun 2021 23:02:59 +0800 -Subject: net: moxa: Use devm_platform_get_and_ioremap_resource() - -From: Yang Yingliang - -[ 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 -Signed-off-by: David S. Miller -Signed-off-by: Sasha Levin ---- - 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 - diff --git a/queue-4.14/series b/queue-4.14/series index b220592f1ca..c319e7929fe 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -178,7 +178,6 @@ dm-space-maps-don-t-reset-space-map-allocation-curso.patch 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 diff --git a/queue-4.19/net-moxa-use-devm_platform_get_and_ioremap_resource.patch b/queue-4.19/net-moxa-use-devm_platform_get_and_ioremap_resource.patch deleted file mode 100644 index b70fe56a4a4..00000000000 --- a/queue-4.19/net-moxa-use-devm_platform_get_and_ioremap_resource.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 0429310d30cb53c898762db8e0735b611eb3c8cd Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Mon, 7 Jun 2021 23:02:59 +0800 -Subject: net: moxa: Use devm_platform_get_and_ioremap_resource() - -From: Yang Yingliang - -[ 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 -Signed-off-by: David S. Miller -Signed-off-by: Sasha Levin ---- - 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 - diff --git a/queue-4.19/series b/queue-4.19/series index 2b77e264e21..4ffe17b6966 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -249,7 +249,6 @@ virtio_net-remove-bug-to-avoid-machine-dead.patch 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 diff --git a/queue-4.4/net-moxa-use-devm_platform_get_and_ioremap_resource.patch b/queue-4.4/net-moxa-use-devm_platform_get_and_ioremap_resource.patch deleted file mode 100644 index e8dfa994929..00000000000 --- a/queue-4.4/net-moxa-use-devm_platform_get_and_ioremap_resource.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 6e05f36367a2588ec603dd5c8591c48e7ce20334 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Mon, 7 Jun 2021 23:02:59 +0800 -Subject: net: moxa: Use devm_platform_get_and_ioremap_resource() - -From: Yang Yingliang - -[ 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 -Signed-off-by: David S. Miller -Signed-off-by: Sasha Levin ---- - 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 - diff --git a/queue-4.4/series b/queue-4.4/series index 328c4d0a60c..782e9997fa2 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -105,7 +105,6 @@ ipv6-use-prandom_u32-for-id-generation.patch 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 diff --git a/queue-4.9/net-moxa-use-devm_platform_get_and_ioremap_resource.patch b/queue-4.9/net-moxa-use-devm_platform_get_and_ioremap_resource.patch deleted file mode 100644 index d0ddb482204..00000000000 --- a/queue-4.9/net-moxa-use-devm_platform_get_and_ioremap_resource.patch +++ /dev/null @@ -1,43 +0,0 @@ -From cd8f4d5f36e62966eb94ad2bb0d594848f775e61 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Mon, 7 Jun 2021 23:02:59 +0800 -Subject: net: moxa: Use devm_platform_get_and_ioremap_resource() - -From: Yang Yingliang - -[ 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 -Signed-off-by: David S. Miller -Signed-off-by: Sasha Levin ---- - 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 - diff --git a/queue-4.9/series b/queue-4.9/series index ea2c7a526b8..6e308c463fb 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -136,7 +136,6 @@ ipv6-use-prandom_u32-for-id-generation.patch 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 diff --git a/queue-5.10/series b/queue-5.10/series index 4d4702ae0fc..6a15c26083c 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -176,7 +176,6 @@ asoc-tegra-set-driver_name-tegra-for-all-machine-drivers.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 diff --git a/queue-5.10/xfrm-policy-read-seqcount-outside-of-rcu-read-side-in-xfrm_policy_lookup_bytype.patch b/queue-5.10/xfrm-policy-read-seqcount-outside-of-rcu-read-side-in-xfrm_policy_lookup_bytype.patch deleted file mode 100644 index 853a74ac058..00000000000 --- a/queue-5.10/xfrm-policy-read-seqcount-outside-of-rcu-read-side-in-xfrm_policy_lookup_bytype.patch +++ /dev/null @@ -1,103 +0,0 @@ -From d7b0408934c749f546b01f2b33d07421a49b6f3e Mon Sep 17 00:00:00 2001 -From: Varad Gautam -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 - -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 - - -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 -Cc: linux-rt-users -Cc: netdev@vger.kernel.org -Cc: stable@vger.kernel.org # v4.9 -Cc: Steffen Klassert -Cc: Herbert Xu -Cc: "David S. Miller" -Cc: Jakub Kicinski -Cc: Florian Westphal -Cc: "Ahmed S. Darwish" -Signed-off-by: Steffen Klassert -Acked-by: Ahmed S. Darwish -Signed-off-by: Greg Kroah-Hartman - ---- - 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(); - diff --git a/queue-5.12/series b/queue-5.12/series index ecbca880b63..f9cbaee39b7 100644 --- a/queue-5.12/series +++ b/queue-5.12/series @@ -195,7 +195,6 @@ mwifiex-bring-down-link-before-deleting-interface.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 diff --git a/queue-5.12/xfrm-policy-read-seqcount-outside-of-rcu-read-side-in-xfrm_policy_lookup_bytype.patch b/queue-5.12/xfrm-policy-read-seqcount-outside-of-rcu-read-side-in-xfrm_policy_lookup_bytype.patch deleted file mode 100644 index 853a74ac058..00000000000 --- a/queue-5.12/xfrm-policy-read-seqcount-outside-of-rcu-read-side-in-xfrm_policy_lookup_bytype.patch +++ /dev/null @@ -1,103 +0,0 @@ -From d7b0408934c749f546b01f2b33d07421a49b6f3e Mon Sep 17 00:00:00 2001 -From: Varad Gautam -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 - -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 - - -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 -Cc: linux-rt-users -Cc: netdev@vger.kernel.org -Cc: stable@vger.kernel.org # v4.9 -Cc: Steffen Klassert -Cc: Herbert Xu -Cc: "David S. Miller" -Cc: Jakub Kicinski -Cc: Florian Westphal -Cc: "Ahmed S. Darwish" -Signed-off-by: Steffen Klassert -Acked-by: Ahmed S. Darwish -Signed-off-by: Greg Kroah-Hartman - ---- - 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(); - diff --git a/queue-5.13/series b/queue-5.13/series index e55cd4f03f5..e664548844c 100644 --- a/queue-5.13/series +++ b/queue-5.13/series @@ -219,7 +219,6 @@ mwifiex-bring-down-link-before-deleting-interface.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 diff --git a/queue-5.13/xfrm-policy-read-seqcount-outside-of-rcu-read-side-in-xfrm_policy_lookup_bytype.patch b/queue-5.13/xfrm-policy-read-seqcount-outside-of-rcu-read-side-in-xfrm_policy_lookup_bytype.patch deleted file mode 100644 index 853a74ac058..00000000000 --- a/queue-5.13/xfrm-policy-read-seqcount-outside-of-rcu-read-side-in-xfrm_policy_lookup_bytype.patch +++ /dev/null @@ -1,103 +0,0 @@ -From d7b0408934c749f546b01f2b33d07421a49b6f3e Mon Sep 17 00:00:00 2001 -From: Varad Gautam -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 - -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 - - -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 -Cc: linux-rt-users -Cc: netdev@vger.kernel.org -Cc: stable@vger.kernel.org # v4.9 -Cc: Steffen Klassert -Cc: Herbert Xu -Cc: "David S. Miller" -Cc: Jakub Kicinski -Cc: Florian Westphal -Cc: "Ahmed S. Darwish" -Signed-off-by: Steffen Klassert -Acked-by: Ahmed S. Darwish -Signed-off-by: Greg Kroah-Hartman - ---- - 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(); - diff --git a/queue-5.4/net-moxa-use-devm_platform_get_and_ioremap_resource.patch b/queue-5.4/net-moxa-use-devm_platform_get_and_ioremap_resource.patch deleted file mode 100644 index 1a413812e38..00000000000 --- a/queue-5.4/net-moxa-use-devm_platform_get_and_ioremap_resource.patch +++ /dev/null @@ -1,43 +0,0 @@ -From ae8621da378ce782ab29674d14a413c64fbd4bce Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Mon, 7 Jun 2021 23:02:59 +0800 -Subject: net: moxa: Use devm_platform_get_and_ioremap_resource() - -From: Yang Yingliang - -[ 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 -Signed-off-by: David S. Miller -Signed-off-by: Sasha Levin ---- - 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 - diff --git a/queue-5.4/series b/queue-5.4/series index 32d8ee2ee1d..99afd3023a3 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -28,7 +28,6 @@ virtio_net-remove-bug-to-avoid-machine-dead.patch 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 @@ -94,7 +93,6 @@ mips-fix-mipsel-linux-ld-decompress.c-undefined-reference-to-memmove.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 diff --git a/queue-5.4/xfrm-policy-read-seqcount-outside-of-rcu-read-side-in-xfrm_policy_lookup_bytype.patch b/queue-5.4/xfrm-policy-read-seqcount-outside-of-rcu-read-side-in-xfrm_policy_lookup_bytype.patch deleted file mode 100644 index 232290e8189..00000000000 --- a/queue-5.4/xfrm-policy-read-seqcount-outside-of-rcu-read-side-in-xfrm_policy_lookup_bytype.patch +++ /dev/null @@ -1,102 +0,0 @@ -From d7b0408934c749f546b01f2b33d07421a49b6f3e Mon Sep 17 00:00:00 2001 -From: Varad Gautam -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 - -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 - - -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 -Cc: linux-rt-users -Cc: netdev@vger.kernel.org -Cc: stable@vger.kernel.org # v4.9 -Cc: Steffen Klassert -Cc: Herbert Xu -Cc: "David S. Miller" -Cc: Jakub Kicinski -Cc: Florian Westphal -Cc: "Ahmed S. Darwish" -Signed-off-by: Steffen Klassert -Acked-by: Ahmed S. Darwish -Signed-off-by: Greg Kroah-Hartman ---- - 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(); -