]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 May 2022 10:36:58 +0000 (12:36 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 May 2022 10:36:58 +0000 (12:36 +0200)
added patches:
asoc-dmaengine-restore-null-prepare_slave_config-callback.patch
gpio-pca953x-fix-irq_stat-not-updated-when-irq-is-disabled-irq_mask-not-set.patch
hwmon-adt7470-fix-warning-on-module-removal.patch
net-mlx5-avoid-double-clear-or-set-of-sync-reset-requested.patch
net-mlx5e-ct-fix-queued-up-restore-put-executing-after-relevant-ft-release.patch
net-mlx5e-don-t-match-double-vlan-packets-if-cvlan-is-not-set.patch
net-mlx5e-fix-the-calling-of-update_buffer_lossy-api.patch
net-mlx5e-fix-trust-state-reset-in-reload.patch
nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-download-timeout.patch
nfc-nfcmrvl-main-reorder-destructive-operations-in-nfcmrvl_nci_unregister_dev-to-avoid-bugs.patch
nfc-replace-improper-check-device_is_registered-in-netlink-related-functions.patch
nfsv4-don-t-invalidate-inode-attributes-on-delegation-return.patch
rdma-siw-fix-a-condition-race-issue-in-mpa-request-processing.patch
selftests-seccomp-don-t-call-read-on-tty-from-background-pgrp.patch

15 files changed:
queue-5.10/asoc-dmaengine-restore-null-prepare_slave_config-callback.patch [new file with mode: 0644]
queue-5.10/gpio-pca953x-fix-irq_stat-not-updated-when-irq-is-disabled-irq_mask-not-set.patch [new file with mode: 0644]
queue-5.10/hwmon-adt7470-fix-warning-on-module-removal.patch [new file with mode: 0644]
queue-5.10/net-mlx5-avoid-double-clear-or-set-of-sync-reset-requested.patch [new file with mode: 0644]
queue-5.10/net-mlx5e-ct-fix-queued-up-restore-put-executing-after-relevant-ft-release.patch [new file with mode: 0644]
queue-5.10/net-mlx5e-don-t-match-double-vlan-packets-if-cvlan-is-not-set.patch [new file with mode: 0644]
queue-5.10/net-mlx5e-fix-the-calling-of-update_buffer_lossy-api.patch [new file with mode: 0644]
queue-5.10/net-mlx5e-fix-trust-state-reset-in-reload.patch [new file with mode: 0644]
queue-5.10/nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-download-timeout.patch [new file with mode: 0644]
queue-5.10/nfc-nfcmrvl-main-reorder-destructive-operations-in-nfcmrvl_nci_unregister_dev-to-avoid-bugs.patch [new file with mode: 0644]
queue-5.10/nfc-replace-improper-check-device_is_registered-in-netlink-related-functions.patch [new file with mode: 0644]
queue-5.10/nfsv4-don-t-invalidate-inode-attributes-on-delegation-return.patch [new file with mode: 0644]
queue-5.10/rdma-siw-fix-a-condition-race-issue-in-mpa-request-processing.patch [new file with mode: 0644]
queue-5.10/selftests-seccomp-don-t-call-read-on-tty-from-background-pgrp.patch [new file with mode: 0644]
queue-5.10/series

diff --git a/queue-5.10/asoc-dmaengine-restore-null-prepare_slave_config-callback.patch b/queue-5.10/asoc-dmaengine-restore-null-prepare_slave_config-callback.patch
new file mode 100644 (file)
index 0000000..2831fb3
--- /dev/null
@@ -0,0 +1,49 @@
+From 660564fc9a92a893a14f255be434f7ea0b967901 Mon Sep 17 00:00:00 2001
+From: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
+Date: Thu, 21 Apr 2022 15:54:02 +0300
+Subject: ASoC: dmaengine: Restore NULL prepare_slave_config() callback
+
+From: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
+
+commit 660564fc9a92a893a14f255be434f7ea0b967901 upstream.
+
+As pointed out by Sascha Hauer, this patch changes:
+if (pmc->config && !pcm->config->prepare_slave_config)
+        <do nothing>
+to:
+if (pmc->config && !pcm->config->prepare_slave_config)
+        snd_dmaengine_pcm_prepare_slave_config()
+
+This breaks the drivers that do not need a call to
+dmaengine_slave_config(). Drivers that still need to call
+snd_dmaengine_pcm_prepare_slave_config(), but have a NULL
+pcm->config->prepare_slave_config should use
+snd_dmaengine_pcm_prepare_slave_config() as their prepare_slave_config
+callback.
+
+Fixes: 9a1e13440a4f ("ASoC: dmaengine: do not use a NULL prepare_slave_config() callback")
+Reported-by: Sascha Hauer <sha@pengutronix.de>
+Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
+Link: https://lore.kernel.org/r/20220421125403.2180824-1-codrin.ciubotariu@microchip.com
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ sound/soc/soc-generic-dmaengine-pcm.c |    6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/sound/soc/soc-generic-dmaengine-pcm.c
++++ b/sound/soc/soc-generic-dmaengine-pcm.c
+@@ -83,10 +83,10 @@ static int dmaengine_pcm_hw_params(struc
+       memset(&slave_config, 0, sizeof(slave_config));
+-      if (pcm->config && pcm->config->prepare_slave_config)
+-              prepare_slave_config = pcm->config->prepare_slave_config;
+-      else
++      if (!pcm->config)
+               prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config;
++      else
++              prepare_slave_config = pcm->config->prepare_slave_config;
+       if (prepare_slave_config) {
+               ret = prepare_slave_config(substream, params, &slave_config);
diff --git a/queue-5.10/gpio-pca953x-fix-irq_stat-not-updated-when-irq-is-disabled-irq_mask-not-set.patch b/queue-5.10/gpio-pca953x-fix-irq_stat-not-updated-when-irq-is-disabled-irq_mask-not-set.patch
new file mode 100644 (file)
index 0000000..646a16d
--- /dev/null
@@ -0,0 +1,39 @@
+From dba785798526a3282cc4d0f0ea751883715dbbb4 Mon Sep 17 00:00:00 2001
+From: Puyou Lu <puyou.lu@gmail.com>
+Date: Fri, 6 May 2022 16:06:30 +0800
+Subject: gpio: pca953x: fix irq_stat not updated when irq is disabled (irq_mask not set)
+
+From: Puyou Lu <puyou.lu@gmail.com>
+
+commit dba785798526a3282cc4d0f0ea751883715dbbb4 upstream.
+
+When one port's input state get inverted (eg. from low to hight) after
+pca953x_irq_setup but before setting irq_mask (by some other driver such as
+"gpio-keys"), the next inversion of this port (eg. from hight to low) will not
+be triggered any more (because irq_stat is not updated at the first time). Issue
+should be fixed after this commit.
+
+Fixes: 89ea8bbe9c3e ("gpio: pca953x.c: add interrupt handling capability")
+Signed-off-by: Puyou Lu <puyou.lu@gmail.com>
+Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpio/gpio-pca953x.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/gpio/gpio-pca953x.c
++++ b/drivers/gpio/gpio-pca953x.c
+@@ -761,11 +761,11 @@ static bool pca953x_irq_pending(struct p
+       bitmap_xor(cur_stat, new_stat, old_stat, gc->ngpio);
+       bitmap_and(trigger, cur_stat, chip->irq_mask, gc->ngpio);
++      bitmap_copy(chip->irq_stat, new_stat, gc->ngpio);
++
+       if (bitmap_empty(trigger, gc->ngpio))
+               return false;
+-      bitmap_copy(chip->irq_stat, new_stat, gc->ngpio);
+-
+       bitmap_and(cur_stat, chip->irq_trig_fall, old_stat, gc->ngpio);
+       bitmap_and(old_stat, chip->irq_trig_raise, new_stat, gc->ngpio);
+       bitmap_or(new_stat, old_stat, cur_stat, gc->ngpio);
diff --git a/queue-5.10/hwmon-adt7470-fix-warning-on-module-removal.patch b/queue-5.10/hwmon-adt7470-fix-warning-on-module-removal.patch
new file mode 100644 (file)
index 0000000..87edf48
--- /dev/null
@@ -0,0 +1,57 @@
+From 7b2666ce445c700b8dcee994da44ddcf050a0842 Mon Sep 17 00:00:00 2001
+From: Armin Wolf <W_Armin@gmx.de>
+Date: Thu, 7 Apr 2022 12:13:12 +0200
+Subject: hwmon: (adt7470) Fix warning on module removal
+
+From: Armin Wolf <W_Armin@gmx.de>
+
+commit 7b2666ce445c700b8dcee994da44ddcf050a0842 upstream.
+
+When removing the adt7470 module, a warning might be printed:
+
+do not call blocking ops when !TASK_RUNNING; state=1
+set at [<ffffffffa006052b>] adt7470_update_thread+0x7b/0x130 [adt7470]
+
+This happens because adt7470_update_thread() can leave the kthread in
+TASK_INTERRUPTIBLE state when the kthread is being stopped before
+the call of set_current_state(). Since kthread_exit() might sleep in
+exit_signals(), the warning is printed.
+Fix that by using schedule_timeout_interruptible() and removing
+the call of set_current_state().
+This causes TASK_INTERRUPTIBLE to be set after kthread_should_stop()
+which might cause the kthread to exit.
+
+Reported-by: Zheyu Ma <zheyuma97@gmail.com>
+Fixes: 93cacfd41f82 (hwmon: (adt7470) Allow faster removal)
+Signed-off-by: Armin Wolf <W_Armin@gmx.de>
+Tested-by: Zheyu Ma <zheyuma97@gmail.com>
+Link: https://lore.kernel.org/r/20220407101312.13331-1-W_Armin@gmx.de
+Signed-off-by: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/hwmon/adt7470.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/hwmon/adt7470.c
++++ b/drivers/hwmon/adt7470.c
+@@ -20,6 +20,7 @@
+ #include <linux/kthread.h>
+ #include <linux/slab.h>
+ #include <linux/util_macros.h>
++#include <linux/sched.h>
+ /* Addresses to scan */
+ static const unsigned short normal_i2c[] = { 0x2C, 0x2E, 0x2F, I2C_CLIENT_END };
+@@ -260,11 +261,10 @@ static int adt7470_update_thread(void *p
+               adt7470_read_temperatures(client, data);
+               mutex_unlock(&data->lock);
+-              set_current_state(TASK_INTERRUPTIBLE);
+               if (kthread_should_stop())
+                       break;
+-              schedule_timeout(msecs_to_jiffies(data->auto_update_interval));
++              schedule_timeout_interruptible(msecs_to_jiffies(data->auto_update_interval));
+       }
+       return 0;
diff --git a/queue-5.10/net-mlx5-avoid-double-clear-or-set-of-sync-reset-requested.patch b/queue-5.10/net-mlx5-avoid-double-clear-or-set-of-sync-reset-requested.patch
new file mode 100644 (file)
index 0000000..8b6102d
--- /dev/null
@@ -0,0 +1,103 @@
+From fc3d3db07b35885f238e1fa06b9f04a8fa7a62d0 Mon Sep 17 00:00:00 2001
+From: Moshe Shemesh <moshe@nvidia.com>
+Date: Mon, 11 Apr 2022 20:38:44 +0300
+Subject: net/mlx5: Avoid double clear or set of sync reset requested
+
+From: Moshe Shemesh <moshe@nvidia.com>
+
+commit fc3d3db07b35885f238e1fa06b9f04a8fa7a62d0 upstream.
+
+Double clear of reset requested state can lead to NULL pointer as it
+will try to delete the timer twice. This can happen for example on a
+race between abort from FW and pci error or reset. Avoid such case using
+test_and_clear_bit() to verify only one time reset requested state clear
+flow. Similarly use test_and_set_bit() to verify only one time reset
+requested state set flow.
+
+Fixes: 7dd6df329d4c ("net/mlx5: Handle sync reset abort event")
+Signed-off-by: Moshe Shemesh <moshe@nvidia.com>
+Reviewed-by: Maher Sanalla <msanalla@nvidia.com>
+Reviewed-by: Shay Drory <shayd@nvidia.com>
+Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c |   28 ++++++++++++++-------
+ 1 file changed, 19 insertions(+), 9 deletions(-)
+
+--- a/drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c
++++ b/drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c
+@@ -134,14 +134,19 @@ static void mlx5_stop_sync_reset_poll(st
+       del_timer_sync(&fw_reset->timer);
+ }
+-static void mlx5_sync_reset_clear_reset_requested(struct mlx5_core_dev *dev, bool poll_health)
++static int mlx5_sync_reset_clear_reset_requested(struct mlx5_core_dev *dev, bool poll_health)
+ {
+       struct mlx5_fw_reset *fw_reset = dev->priv.fw_reset;
++      if (!test_and_clear_bit(MLX5_FW_RESET_FLAGS_RESET_REQUESTED, &fw_reset->reset_flags)) {
++              mlx5_core_warn(dev, "Reset request was already cleared\n");
++              return -EALREADY;
++      }
++
+       mlx5_stop_sync_reset_poll(dev);
+-      clear_bit(MLX5_FW_RESET_FLAGS_RESET_REQUESTED, &fw_reset->reset_flags);
+       if (poll_health)
+               mlx5_start_health_poll(dev);
++      return 0;
+ }
+ #define MLX5_RESET_POLL_INTERVAL      (HZ / 10)
+@@ -185,13 +190,17 @@ static int mlx5_fw_reset_set_reset_sync_
+       return mlx5_reg_mfrl_set(dev, MLX5_MFRL_REG_RESET_LEVEL3, 0, 2, false);
+ }
+-static void mlx5_sync_reset_set_reset_requested(struct mlx5_core_dev *dev)
++static int mlx5_sync_reset_set_reset_requested(struct mlx5_core_dev *dev)
+ {
+       struct mlx5_fw_reset *fw_reset = dev->priv.fw_reset;
++      if (test_and_set_bit(MLX5_FW_RESET_FLAGS_RESET_REQUESTED, &fw_reset->reset_flags)) {
++              mlx5_core_warn(dev, "Reset request was already set\n");
++              return -EALREADY;
++      }
+       mlx5_stop_health_poll(dev, true);
+-      set_bit(MLX5_FW_RESET_FLAGS_RESET_REQUESTED, &fw_reset->reset_flags);
+       mlx5_start_sync_reset_poll(dev);
++      return 0;
+ }
+ static void mlx5_fw_live_patch_event(struct work_struct *work)
+@@ -225,7 +234,9 @@ static void mlx5_sync_reset_request_even
+                              err ? "Failed" : "Sent");
+               return;
+       }
+-      mlx5_sync_reset_set_reset_requested(dev);
++      if (mlx5_sync_reset_set_reset_requested(dev))
++              return;
++
+       err = mlx5_fw_reset_set_reset_sync_ack(dev);
+       if (err)
+               mlx5_core_warn(dev, "PCI Sync FW Update Reset Ack Failed. Error code: %d\n", err);
+@@ -325,7 +336,8 @@ static void mlx5_sync_reset_now_event(st
+       struct mlx5_core_dev *dev = fw_reset->dev;
+       int err;
+-      mlx5_sync_reset_clear_reset_requested(dev, false);
++      if (mlx5_sync_reset_clear_reset_requested(dev, false))
++              return;
+       mlx5_core_warn(dev, "Sync Reset now. Device is going to reset.\n");
+@@ -354,10 +366,8 @@ static void mlx5_sync_reset_abort_event(
+                                                     reset_abort_work);
+       struct mlx5_core_dev *dev = fw_reset->dev;
+-      if (!test_bit(MLX5_FW_RESET_FLAGS_RESET_REQUESTED, &fw_reset->reset_flags))
++      if (mlx5_sync_reset_clear_reset_requested(dev, true))
+               return;
+-
+-      mlx5_sync_reset_clear_reset_requested(dev, true);
+       mlx5_core_warn(dev, "PCI Sync FW Update Reset Aborted.\n");
+ }
diff --git a/queue-5.10/net-mlx5e-ct-fix-queued-up-restore-put-executing-after-relevant-ft-release.patch b/queue-5.10/net-mlx5e-ct-fix-queued-up-restore-put-executing-after-relevant-ft-release.patch
new file mode 100644 (file)
index 0000000..ff33e28
--- /dev/null
@@ -0,0 +1,44 @@
+From b069e14fff46c8da9fcc79957f8acaa3e2dfdb6b Mon Sep 17 00:00:00 2001
+From: Paul Blakey <paulb@nvidia.com>
+Date: Tue, 29 Mar 2022 17:42:46 +0300
+Subject: net/mlx5e: CT: Fix queued up restore put() executing after relevant ft release
+
+From: Paul Blakey <paulb@nvidia.com>
+
+commit b069e14fff46c8da9fcc79957f8acaa3e2dfdb6b upstream.
+
+__mlx5_tc_ct_entry_put() queues release of tuple related to some ct FT,
+if that is the last reference to that tuple, the actual deletion of
+the tuple can happen after the FT is already destroyed and freed.
+
+Flush the used workqueue before destroying the ct FT.
+
+Fixes: a2173131526d ("net/mlx5e: CT: manage the lifetime of the ct entry object")
+Reviewed-by: Oz Shlomo <ozsh@nvidia.com>
+Signed-off-by: Paul Blakey <paulb@nvidia.com>
+Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c |    4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c
++++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c
+@@ -1629,6 +1629,8 @@ mlx5_tc_ct_flush_ft_entry(void *ptr, voi
+ static void
+ mlx5_tc_ct_del_ft_cb(struct mlx5_tc_ct_priv *ct_priv, struct mlx5_ct_ft *ft)
+ {
++      struct mlx5e_priv *priv;
++
+       if (!refcount_dec_and_test(&ft->refcount))
+               return;
+@@ -1638,6 +1640,8 @@ mlx5_tc_ct_del_ft_cb(struct mlx5_tc_ct_p
+       rhashtable_free_and_destroy(&ft->ct_entries_ht,
+                                   mlx5_tc_ct_flush_ft_entry,
+                                   ct_priv);
++      priv = netdev_priv(ct_priv->netdev);
++      flush_workqueue(priv->wq);
+       mlx5_tc_ct_free_pre_ct_tables(ft);
+       mapping_remove(ct_priv->zone_mapping, ft->zone_restore_id);
+       kfree(ft);
diff --git a/queue-5.10/net-mlx5e-don-t-match-double-vlan-packets-if-cvlan-is-not-set.patch b/queue-5.10/net-mlx5e-don-t-match-double-vlan-packets-if-cvlan-is-not-set.patch
new file mode 100644 (file)
index 0000000..955990b
--- /dev/null
@@ -0,0 +1,44 @@
+From ada09af92e621ab500dd80a16d1d0299a18a1180 Mon Sep 17 00:00:00 2001
+From: Vlad Buslov <vladbu@nvidia.com>
+Date: Mon, 28 Mar 2022 15:54:52 +0300
+Subject: net/mlx5e: Don't match double-vlan packets if cvlan is not set
+
+From: Vlad Buslov <vladbu@nvidia.com>
+
+commit ada09af92e621ab500dd80a16d1d0299a18a1180 upstream.
+
+Currently, match VLAN rule also matches packets that have multiple VLAN
+headers. This behavior is similar to buggy flower classifier behavior that
+has recently been fixed. Fix the issue by matching on
+outer_second_cvlan_tag with value 0 which will cause the HW to verify the
+packet doesn't contain second vlan header.
+
+Fixes: 699e96ddf47f ("net/mlx5e: Support offloading tc double vlan headers match")
+Signed-off-by: Vlad Buslov <vladbu@nvidia.com>
+Reviewed-by: Maor Dickman <maord@nvidia.com>
+Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/mellanox/mlx5/core/en_tc.c |   11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
++++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+@@ -2396,6 +2396,17 @@ static int __parse_cls_flower(struct mlx
+                                match.key->vlan_priority);
+                       *match_level = MLX5_MATCH_L2;
++
++                      if (!flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_CVLAN) &&
++                          match.mask->vlan_eth_type &&
++                          MLX5_CAP_FLOWTABLE_TYPE(priv->mdev,
++                                                  ft_field_support.outer_second_vid,
++                                                  fs_type)) {
++                              MLX5_SET(fte_match_set_misc, misc_c,
++                                       outer_second_cvlan_tag, 1);
++                              spec->match_criteria_enable |=
++                                      MLX5_MATCH_MISC_PARAMETERS;
++                      }
+               }
+       } else if (*match_level != MLX5_MATCH_NONE) {
+               /* cvlan_tag enabled in match criteria and
diff --git a/queue-5.10/net-mlx5e-fix-the-calling-of-update_buffer_lossy-api.patch b/queue-5.10/net-mlx5e-fix-the-calling-of-update_buffer_lossy-api.patch
new file mode 100644 (file)
index 0000000..ea27070
--- /dev/null
@@ -0,0 +1,33 @@
+From c4d963a588a6e7c4ef31160e80697ae8e5a47746 Mon Sep 17 00:00:00 2001
+From: Mark Zhang <markzhang@nvidia.com>
+Date: Wed, 6 Apr 2022 10:30:21 +0300
+Subject: net/mlx5e: Fix the calling of update_buffer_lossy() API
+
+From: Mark Zhang <markzhang@nvidia.com>
+
+commit c4d963a588a6e7c4ef31160e80697ae8e5a47746 upstream.
+
+The arguments of update_buffer_lossy() is in a wrong order. Fix it.
+
+Fixes: 88b3d5c90e96 ("net/mlx5e: Fix port buffers cell size value")
+Signed-off-by: Mark Zhang <markzhang@nvidia.com>
+Reviewed-by: Maor Gottlieb <maorg@nvidia.com>
+Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/mellanox/mlx5/core/en/port_buffer.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/ethernet/mellanox/mlx5/core/en/port_buffer.c
++++ b/drivers/net/ethernet/mellanox/mlx5/core/en/port_buffer.c
+@@ -309,8 +309,8 @@ int mlx5e_port_manual_buffer_config(stru
+               if (err)
+                       return err;
+-              err = update_buffer_lossy(max_mtu, curr_pfc_en, prio2buffer, port_buff_cell_sz,
+-                                        xoff, &port_buffer, &update_buffer);
++              err = update_buffer_lossy(max_mtu, curr_pfc_en, prio2buffer, xoff,
++                                        port_buff_cell_sz, &port_buffer, &update_buffer);
+               if (err)
+                       return err;
+       }
diff --git a/queue-5.10/net-mlx5e-fix-trust-state-reset-in-reload.patch b/queue-5.10/net-mlx5e-fix-trust-state-reset-in-reload.patch
new file mode 100644 (file)
index 0000000..5348544
--- /dev/null
@@ -0,0 +1,44 @@
+From b781bff882d16175277ca129c382886cb4c74a2c Mon Sep 17 00:00:00 2001
+From: Moshe Tal <moshet@nvidia.com>
+Date: Wed, 9 Feb 2022 19:23:56 +0200
+Subject: net/mlx5e: Fix trust state reset in reload
+
+From: Moshe Tal <moshet@nvidia.com>
+
+commit b781bff882d16175277ca129c382886cb4c74a2c upstream.
+
+Setting dscp2prio during the driver reload can cause dcb ieee app list to
+be not empty after the reload finish and as a result to a conflict between
+the priority trust state reported by the app and the state in the device
+register.
+
+Reset the dcb ieee app list on initialization in case this is
+conflicting with the register status.
+
+Fixes: 2a5e7a1344f4 ("net/mlx5e: Add dcbnl dscp to priority support")
+Signed-off-by: Moshe Tal <moshet@nvidia.com>
+Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c |   10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+--- a/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c
++++ b/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c
+@@ -1210,6 +1210,16 @@ static int mlx5e_trust_initialize(struct
+       if (err)
+               return err;
++      if (priv->dcbx_dp.trust_state == MLX5_QPTS_TRUST_PCP && priv->dcbx.dscp_app_cnt) {
++              /*
++               * Align the driver state with the register state.
++               * Temporary state change is required to enable the app list reset.
++               */
++              priv->dcbx_dp.trust_state = MLX5_QPTS_TRUST_DSCP;
++              mlx5e_dcbnl_delete_app(priv);
++              priv->dcbx_dp.trust_state = MLX5_QPTS_TRUST_PCP;
++      }
++
+       mlx5e_params_calc_trust_tx_min_inline_mode(priv->mdev, &priv->channels.params,
+                                                  priv->dcbx_dp.trust_state);
diff --git a/queue-5.10/nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-download-timeout.patch b/queue-5.10/nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-download-timeout.patch
new file mode 100644 (file)
index 0000000..111e09e
--- /dev/null
@@ -0,0 +1,65 @@
+From 4071bf121d59944d5cd2238de0642f3d7995a997 Mon Sep 17 00:00:00 2001
+From: Duoming Zhou <duoming@zju.edu.cn>
+Date: Wed, 4 May 2022 13:58:47 +0800
+Subject: NFC: netlink: fix sleep in atomic bug when firmware download timeout
+
+From: Duoming Zhou <duoming@zju.edu.cn>
+
+commit 4071bf121d59944d5cd2238de0642f3d7995a997 upstream.
+
+There are sleep in atomic bug that could cause kernel panic during
+firmware download process. The root cause is that nlmsg_new with
+GFP_KERNEL parameter is called in fw_dnld_timeout which is a timer
+handler. The call trace is shown below:
+
+BUG: sleeping function called from invalid context at include/linux/sched/mm.h:265
+Call Trace:
+kmem_cache_alloc_node
+__alloc_skb
+nfc_genl_fw_download_done
+call_timer_fn
+__run_timers.part.0
+run_timer_softirq
+__do_softirq
+...
+
+The nlmsg_new with GFP_KERNEL parameter may sleep during memory
+allocation process, and the timer handler is run as the result of
+a "software interrupt" that should not call any other function
+that could sleep.
+
+This patch changes allocation mode of netlink message from GFP_KERNEL
+to GFP_ATOMIC in order to prevent sleep in atomic bug. The GFP_ATOMIC
+flag makes memory allocation operation could be used in atomic context.
+
+Fixes: 9674da8759df ("NFC: Add firmware upload netlink command")
+Fixes: 9ea7187c53f6 ("NFC: netlink: Rename CMD_FW_UPLOAD to CMD_FW_DOWNLOAD")
+Signed-off-by: Duoming Zhou <duoming@zju.edu.cn>
+Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
+Link: https://lore.kernel.org/r/20220504055847.38026-1-duoming@zju.edu.cn
+Signed-off-by: Paolo Abeni <pabeni@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/nfc/netlink.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/net/nfc/netlink.c
++++ b/net/nfc/netlink.c
+@@ -1244,7 +1244,7 @@ int nfc_genl_fw_download_done(struct nfc
+       struct sk_buff *msg;
+       void *hdr;
+-      msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
++      msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC);
+       if (!msg)
+               return -ENOMEM;
+@@ -1260,7 +1260,7 @@ int nfc_genl_fw_download_done(struct nfc
+       genlmsg_end(msg, hdr);
+-      genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL);
++      genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_ATOMIC);
+       return 0;
diff --git a/queue-5.10/nfc-nfcmrvl-main-reorder-destructive-operations-in-nfcmrvl_nci_unregister_dev-to-avoid-bugs.patch b/queue-5.10/nfc-nfcmrvl-main-reorder-destructive-operations-in-nfcmrvl_nci_unregister_dev-to-avoid-bugs.patch
new file mode 100644 (file)
index 0000000..6933587
--- /dev/null
@@ -0,0 +1,113 @@
+From d270453a0d9ec10bb8a802a142fb1b3601a83098 Mon Sep 17 00:00:00 2001
+From: Duoming Zhou <duoming@zju.edu.cn>
+Date: Fri, 29 Apr 2022 20:45:51 +0800
+Subject: nfc: nfcmrvl: main: reorder destructive operations in nfcmrvl_nci_unregister_dev to avoid bugs
+
+From: Duoming Zhou <duoming@zju.edu.cn>
+
+commit d270453a0d9ec10bb8a802a142fb1b3601a83098 upstream.
+
+There are destructive operations such as nfcmrvl_fw_dnld_abort and
+gpio_free in nfcmrvl_nci_unregister_dev. The resources such as firmware,
+gpio and so on could be destructed while the upper layer functions such as
+nfcmrvl_fw_dnld_start and nfcmrvl_nci_recv_frame is executing, which leads
+to double-free, use-after-free and null-ptr-deref bugs.
+
+There are three situations that could lead to double-free bugs.
+
+The first situation is shown below:
+
+   (Thread 1)                 |      (Thread 2)
+nfcmrvl_fw_dnld_start         |
+ ...                          |  nfcmrvl_nci_unregister_dev
+ release_firmware()           |   nfcmrvl_fw_dnld_abort
+  kfree(fw) //(1)             |    fw_dnld_over
+                              |     release_firmware
+  ...                         |      kfree(fw) //(2)
+                              |     ...
+
+The second situation is shown below:
+
+   (Thread 1)                 |      (Thread 2)
+nfcmrvl_fw_dnld_start         |
+ ...                          |
+ mod_timer                    |
+ (wait a time)                |
+ fw_dnld_timeout              |  nfcmrvl_nci_unregister_dev
+   fw_dnld_over               |   nfcmrvl_fw_dnld_abort
+    release_firmware          |    fw_dnld_over
+     kfree(fw) //(1)          |     release_firmware
+     ...                      |      kfree(fw) //(2)
+
+The third situation is shown below:
+
+       (Thread 1)               |       (Thread 2)
+nfcmrvl_nci_recv_frame          |
+ if(..->fw_download_in_progress)|
+  nfcmrvl_fw_dnld_recv_frame    |
+   queue_work                   |
+                                |
+fw_dnld_rx_work                 | nfcmrvl_nci_unregister_dev
+ fw_dnld_over                   |  nfcmrvl_fw_dnld_abort
+  release_firmware              |   fw_dnld_over
+   kfree(fw) //(1)              |    release_firmware
+                                |     kfree(fw) //(2)
+
+The firmware struct is deallocated in position (1) and deallocated
+in position (2) again.
+
+The crash trace triggered by POC is like below:
+
+BUG: KASAN: double-free or invalid-free in fw_dnld_over
+Call Trace:
+  kfree
+  fw_dnld_over
+  nfcmrvl_nci_unregister_dev
+  nci_uart_tty_close
+  tty_ldisc_kill
+  tty_ldisc_hangup
+  __tty_hangup.part.0
+  tty_release
+  ...
+
+What's more, there are also use-after-free and null-ptr-deref bugs
+in nfcmrvl_fw_dnld_start. If we deallocate firmware struct, gpio or
+set null to the members of priv->fw_dnld in nfcmrvl_nci_unregister_dev,
+then, we dereference firmware, gpio or the members of priv->fw_dnld in
+nfcmrvl_fw_dnld_start, the UAF or NPD bugs will happen.
+
+This patch reorders destructive operations after nci_unregister_device
+in order to synchronize between cleanup routine and firmware download
+routine.
+
+The nci_unregister_device is well synchronized. If the device is
+detaching, the firmware download routine will goto error. If firmware
+download routine is executing, nci_unregister_device will wait until
+firmware download routine is finished.
+
+Fixes: 3194c6870158 ("NFC: nfcmrvl: add firmware download support")
+Signed-off-by: Duoming Zhou <duoming@zju.edu.cn>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/nfc/nfcmrvl/main.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/nfc/nfcmrvl/main.c
++++ b/drivers/nfc/nfcmrvl/main.c
+@@ -194,6 +194,7 @@ void nfcmrvl_nci_unregister_dev(struct n
+ {
+       struct nci_dev *ndev = priv->ndev;
++      nci_unregister_device(ndev);
+       if (priv->ndev->nfc_dev->fw_download_in_progress)
+               nfcmrvl_fw_dnld_abort(priv);
+@@ -202,7 +203,6 @@ void nfcmrvl_nci_unregister_dev(struct n
+       if (gpio_is_valid(priv->config.reset_n_io))
+               gpio_free(priv->config.reset_n_io);
+-      nci_unregister_device(ndev);
+       nci_free_device(ndev);
+       kfree(priv);
+ }
diff --git a/queue-5.10/nfc-replace-improper-check-device_is_registered-in-netlink-related-functions.patch b/queue-5.10/nfc-replace-improper-check-device_is_registered-in-netlink-related-functions.patch
new file mode 100644 (file)
index 0000000..92a62cb
--- /dev/null
@@ -0,0 +1,172 @@
+From da5c0f119203ad9728920456a0f52a6d850c01cd Mon Sep 17 00:00:00 2001
+From: Duoming Zhou <duoming@zju.edu.cn>
+Date: Fri, 29 Apr 2022 20:45:50 +0800
+Subject: nfc: replace improper check device_is_registered() in netlink related functions
+
+From: Duoming Zhou <duoming@zju.edu.cn>
+
+commit da5c0f119203ad9728920456a0f52a6d850c01cd upstream.
+
+The device_is_registered() in nfc core is used to check whether
+nfc device is registered in netlink related functions such as
+nfc_fw_download(), nfc_dev_up() and so on. Although device_is_registered()
+is protected by device_lock, there is still a race condition between
+device_del() and device_is_registered(). The root cause is that
+kobject_del() in device_del() is not protected by device_lock.
+
+   (cleanup task)         |     (netlink task)
+                          |
+nfc_unregister_device     | nfc_fw_download
+ device_del               |  device_lock
+  ...                     |   if (!device_is_registered)//(1)
+  kobject_del//(2)        |   ...
+ ...                      |  device_unlock
+
+The device_is_registered() returns the value of state_in_sysfs and
+the state_in_sysfs is set to zero in kobject_del(). If we pass check in
+position (1), then set zero in position (2). As a result, the check
+in position (1) is useless.
+
+This patch uses bool variable instead of device_is_registered() to judge
+whether the nfc device is registered, which is well synchronized.
+
+Fixes: 3e256b8f8dfa ("NFC: add nfc subsystem core")
+Signed-off-by: Duoming Zhou <duoming@zju.edu.cn>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/nfc/core.c |   29 ++++++++++++++---------------
+ 1 file changed, 14 insertions(+), 15 deletions(-)
+
+--- a/net/nfc/core.c
++++ b/net/nfc/core.c
+@@ -38,7 +38,7 @@ int nfc_fw_download(struct nfc_dev *dev,
+       device_lock(&dev->dev);
+-      if (!device_is_registered(&dev->dev)) {
++      if (dev->shutting_down) {
+               rc = -ENODEV;
+               goto error;
+       }
+@@ -94,7 +94,7 @@ int nfc_dev_up(struct nfc_dev *dev)
+       device_lock(&dev->dev);
+-      if (!device_is_registered(&dev->dev)) {
++      if (dev->shutting_down) {
+               rc = -ENODEV;
+               goto error;
+       }
+@@ -142,7 +142,7 @@ int nfc_dev_down(struct nfc_dev *dev)
+       device_lock(&dev->dev);
+-      if (!device_is_registered(&dev->dev)) {
++      if (dev->shutting_down) {
+               rc = -ENODEV;
+               goto error;
+       }
+@@ -206,7 +206,7 @@ int nfc_start_poll(struct nfc_dev *dev,
+       device_lock(&dev->dev);
+-      if (!device_is_registered(&dev->dev)) {
++      if (dev->shutting_down) {
+               rc = -ENODEV;
+               goto error;
+       }
+@@ -245,7 +245,7 @@ int nfc_stop_poll(struct nfc_dev *dev)
+       device_lock(&dev->dev);
+-      if (!device_is_registered(&dev->dev)) {
++      if (dev->shutting_down) {
+               rc = -ENODEV;
+               goto error;
+       }
+@@ -290,7 +290,7 @@ int nfc_dep_link_up(struct nfc_dev *dev,
+       device_lock(&dev->dev);
+-      if (!device_is_registered(&dev->dev)) {
++      if (dev->shutting_down) {
+               rc = -ENODEV;
+               goto error;
+       }
+@@ -334,7 +334,7 @@ int nfc_dep_link_down(struct nfc_dev *de
+       device_lock(&dev->dev);
+-      if (!device_is_registered(&dev->dev)) {
++      if (dev->shutting_down) {
+               rc = -ENODEV;
+               goto error;
+       }
+@@ -400,7 +400,7 @@ int nfc_activate_target(struct nfc_dev *
+       device_lock(&dev->dev);
+-      if (!device_is_registered(&dev->dev)) {
++      if (dev->shutting_down) {
+               rc = -ENODEV;
+               goto error;
+       }
+@@ -446,7 +446,7 @@ int nfc_deactivate_target(struct nfc_dev
+       device_lock(&dev->dev);
+-      if (!device_is_registered(&dev->dev)) {
++      if (dev->shutting_down) {
+               rc = -ENODEV;
+               goto error;
+       }
+@@ -493,7 +493,7 @@ int nfc_data_exchange(struct nfc_dev *de
+       device_lock(&dev->dev);
+-      if (!device_is_registered(&dev->dev)) {
++      if (dev->shutting_down) {
+               rc = -ENODEV;
+               kfree_skb(skb);
+               goto error;
+@@ -550,7 +550,7 @@ int nfc_enable_se(struct nfc_dev *dev, u
+       device_lock(&dev->dev);
+-      if (!device_is_registered(&dev->dev)) {
++      if (dev->shutting_down) {
+               rc = -ENODEV;
+               goto error;
+       }
+@@ -599,7 +599,7 @@ int nfc_disable_se(struct nfc_dev *dev,
+       device_lock(&dev->dev);
+-      if (!device_is_registered(&dev->dev)) {
++      if (dev->shutting_down) {
+               rc = -ENODEV;
+               goto error;
+       }
+@@ -1126,6 +1126,7 @@ int nfc_register_device(struct nfc_dev *
+                       dev->rfkill = NULL;
+               }
+       }
++      dev->shutting_down = false;
+       device_unlock(&dev->dev);
+       rc = nfc_genl_device_added(dev);
+@@ -1158,12 +1159,10 @@ void nfc_unregister_device(struct nfc_de
+               rfkill_unregister(dev->rfkill);
+               rfkill_destroy(dev->rfkill);
+       }
++      dev->shutting_down = true;
+       device_unlock(&dev->dev);
+       if (dev->ops->check_presence) {
+-              device_lock(&dev->dev);
+-              dev->shutting_down = true;
+-              device_unlock(&dev->dev);
+               del_timer_sync(&dev->check_pres_timer);
+               cancel_work_sync(&dev->check_pres_work);
+       }
diff --git a/queue-5.10/nfsv4-don-t-invalidate-inode-attributes-on-delegation-return.patch b/queue-5.10/nfsv4-don-t-invalidate-inode-attributes-on-delegation-return.patch
new file mode 100644 (file)
index 0000000..392cad3
--- /dev/null
@@ -0,0 +1,51 @@
+From 00c94ebec5925593c0377b941289224469e72ac7 Mon Sep 17 00:00:00 2001
+From: Trond Myklebust <trond.myklebust@hammerspace.com>
+Date: Mon, 25 Apr 2022 18:04:27 -0400
+Subject: NFSv4: Don't invalidate inode attributes on delegation return
+
+From: Trond Myklebust <trond.myklebust@hammerspace.com>
+
+commit 00c94ebec5925593c0377b941289224469e72ac7 upstream.
+
+There is no need to declare attributes such as the ctime, mtime and
+block size invalid when we're just returning a delegation, so it is
+inappropriate to call nfs_post_op_update_inode_force_wcc().
+Instead, just call nfs_refresh_inode() after faking up the change
+attribute. We know that the GETATTR op occurs before the DELEGRETURN, so
+we are safe when doing this.
+
+Fixes: 0bc2c9b4dca9 ("NFSv4: Don't discard the attributes returned by asynchronous DELEGRETURN")
+Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/nfs/nfs4proc.c |   12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+--- a/fs/nfs/nfs4proc.c
++++ b/fs/nfs/nfs4proc.c
+@@ -369,6 +369,14 @@ static void nfs4_setup_readdir(u64 cooki
+       kunmap_atomic(start);
+ }
++static void nfs4_fattr_set_prechange(struct nfs_fattr *fattr, u64 version)
++{
++      if (!(fattr->valid & NFS_ATTR_FATTR_PRECHANGE)) {
++              fattr->pre_change_attr = version;
++              fattr->valid |= NFS_ATTR_FATTR_PRECHANGE;
++      }
++}
++
+ static void nfs4_test_and_free_stateid(struct nfs_server *server,
+               nfs4_stateid *stateid,
+               const struct cred *cred)
+@@ -6464,7 +6472,9 @@ static void nfs4_delegreturn_release(voi
+               pnfs_roc_release(&data->lr.arg, &data->lr.res,
+                                data->res.lr_ret);
+       if (inode) {
+-              nfs_post_op_update_inode_force_wcc(inode, &data->fattr);
++              nfs4_fattr_set_prechange(&data->fattr,
++                                       inode_peek_iversion_raw(inode));
++              nfs_refresh_inode(inode, &data->fattr);
+               nfs_iput_and_deactive(inode);
+       }
+       kfree(calldata);
diff --git a/queue-5.10/rdma-siw-fix-a-condition-race-issue-in-mpa-request-processing.patch b/queue-5.10/rdma-siw-fix-a-condition-race-issue-in-mpa-request-processing.patch
new file mode 100644 (file)
index 0000000..913b3d7
--- /dev/null
@@ -0,0 +1,66 @@
+From ef91271c65c12d36e4c2b61c61d4849fb6d11aa0 Mon Sep 17 00:00:00 2001
+From: Cheng Xu <chengyou@linux.alibaba.com>
+Date: Sun, 24 Apr 2022 16:01:03 +0800
+Subject: RDMA/siw: Fix a condition race issue in MPA request processing
+
+From: Cheng Xu <chengyou@linux.alibaba.com>
+
+commit ef91271c65c12d36e4c2b61c61d4849fb6d11aa0 upstream.
+
+The calling of siw_cm_upcall and detaching new_cep with its listen_cep
+should be atomistic semantics. Otherwise siw_reject may be called in a
+temporary state, e,g, siw_cm_upcall is called but the new_cep->listen_cep
+has not being cleared.
+
+This fixes a WARN:
+
+  WARNING: CPU: 7 PID: 201 at drivers/infiniband/sw/siw/siw_cm.c:255 siw_cep_put+0x125/0x130 [siw]
+  CPU: 2 PID: 201 Comm: kworker/u16:22 Kdump: loaded Tainted: G            E     5.17.0-rc7 #1
+  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
+  Workqueue: iw_cm_wq cm_work_handler [iw_cm]
+  RIP: 0010:siw_cep_put+0x125/0x130 [siw]
+  Call Trace:
+   <TASK>
+   siw_reject+0xac/0x180 [siw]
+   iw_cm_reject+0x68/0xc0 [iw_cm]
+   cm_work_handler+0x59d/0xe20 [iw_cm]
+   process_one_work+0x1e2/0x3b0
+   worker_thread+0x50/0x3a0
+   ? rescuer_thread+0x390/0x390
+   kthread+0xe5/0x110
+   ? kthread_complete_and_exit+0x20/0x20
+   ret_from_fork+0x1f/0x30
+   </TASK>
+
+Fixes: 6c52fdc244b5 ("rdma/siw: connection management")
+Link: https://lore.kernel.org/r/d528d83466c44687f3872eadcb8c184528b2e2d4.1650526554.git.chengyou@linux.alibaba.com
+Reported-by: Luis Chamberlain <mcgrof@kernel.org>
+Reviewed-by: Bernard Metzler <bmt@zurich.ibm.com>
+Signed-off-by: Cheng Xu <chengyou@linux.alibaba.com>
+Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/infiniband/sw/siw/siw_cm.c |    7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+--- a/drivers/infiniband/sw/siw/siw_cm.c
++++ b/drivers/infiniband/sw/siw/siw_cm.c
+@@ -968,14 +968,15 @@ static void siw_accept_newconn(struct si
+               siw_cep_set_inuse(new_cep);
+               rv = siw_proc_mpareq(new_cep);
+-              siw_cep_set_free(new_cep);
+-
+               if (rv != -EAGAIN) {
+                       siw_cep_put(cep);
+                       new_cep->listen_cep = NULL;
+-                      if (rv)
++                      if (rv) {
++                              siw_cep_set_free(new_cep);
+                               goto error;
++                      }
+               }
++              siw_cep_set_free(new_cep);
+       }
+       return;
diff --git a/queue-5.10/selftests-seccomp-don-t-call-read-on-tty-from-background-pgrp.patch b/queue-5.10/selftests-seccomp-don-t-call-read-on-tty-from-background-pgrp.patch
new file mode 100644 (file)
index 0000000..88c3d14
--- /dev/null
@@ -0,0 +1,73 @@
+From 2bfed7d2ffa5d86c462d3e2067f2832eaf8c04c7 Mon Sep 17 00:00:00 2001
+From: Jann Horn <jannh@google.com>
+Date: Sat, 19 Mar 2022 02:00:11 +0100
+Subject: selftests/seccomp: Don't call read() on TTY from background pgrp
+
+From: Jann Horn <jannh@google.com>
+
+commit 2bfed7d2ffa5d86c462d3e2067f2832eaf8c04c7 upstream.
+
+Since commit 92d25637a3a4 ("kselftest: signal all child processes"), tests
+are executed in background process groups. This means that trying to read
+from stdin now throws SIGTTIN when stdin is a TTY, which breaks some
+seccomp selftests that try to use read(0, NULL, 0) as a dummy syscall.
+
+The simplest way to fix that is probably to just use -1 instead of 0 as
+the dummy read()'s FD.
+
+Fixes: 92d25637a3a4 ("kselftest: signal all child processes")
+Signed-off-by: Jann Horn <jannh@google.com>
+Signed-off-by: Kees Cook <keescook@chromium.org>
+Link: https://lore.kernel.org/r/20220319010011.1374622-1-jannh@google.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ tools/testing/selftests/seccomp/seccomp_bpf.c |   10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+--- a/tools/testing/selftests/seccomp/seccomp_bpf.c
++++ b/tools/testing/selftests/seccomp/seccomp_bpf.c
+@@ -951,7 +951,7 @@ TEST(ERRNO_valid)
+       ASSERT_EQ(0, ret);
+       EXPECT_EQ(parent, syscall(__NR_getppid));
+-      EXPECT_EQ(-1, read(0, NULL, 0));
++      EXPECT_EQ(-1, read(-1, NULL, 0));
+       EXPECT_EQ(E2BIG, errno);
+ }
+@@ -970,7 +970,7 @@ TEST(ERRNO_zero)
+       EXPECT_EQ(parent, syscall(__NR_getppid));
+       /* "errno" of 0 is ok. */
+-      EXPECT_EQ(0, read(0, NULL, 0));
++      EXPECT_EQ(0, read(-1, NULL, 0));
+ }
+ /*
+@@ -991,7 +991,7 @@ TEST(ERRNO_capped)
+       ASSERT_EQ(0, ret);
+       EXPECT_EQ(parent, syscall(__NR_getppid));
+-      EXPECT_EQ(-1, read(0, NULL, 0));
++      EXPECT_EQ(-1, read(-1, NULL, 0));
+       EXPECT_EQ(4095, errno);
+ }
+@@ -1022,7 +1022,7 @@ TEST(ERRNO_order)
+       ASSERT_EQ(0, ret);
+       EXPECT_EQ(parent, syscall(__NR_getppid));
+-      EXPECT_EQ(-1, read(0, NULL, 0));
++      EXPECT_EQ(-1, read(-1, NULL, 0));
+       EXPECT_EQ(12, errno);
+ }
+@@ -2575,7 +2575,7 @@ void *tsync_sibling(void *data)
+       ret = prctl(PR_GET_NO_NEW_PRIVS, 0, 0, 0, 0);
+       if (!ret)
+               return (void *)SIBLING_EXIT_NEWPRIVS;
+-      read(0, NULL, 0);
++      read(-1, NULL, 0);
+       return (void *)SIBLING_EXIT_UNKILLED;
+ }
index a8d6f62e453d985239630eaabaec55e9570db31e..b413cecd6ed13147eff1239278c0993659336609 100644 (file)
@@ -29,3 +29,17 @@ can-isotp-remove-re-binding-of-bound-socket.patch
 can-grcan-use-ofdev-dev-when-allocating-dma-memory.patch
 can-grcan-grcan_probe-fix-broken-system-id-check-for-errata-workaround-needs.patch
 can-grcan-only-use-the-napi-poll-budget-for-rx.patch
+nfc-replace-improper-check-device_is_registered-in-netlink-related-functions.patch
+nfc-nfcmrvl-main-reorder-destructive-operations-in-nfcmrvl_nci_unregister_dev-to-avoid-bugs.patch
+nfc-netlink-fix-sleep-in-atomic-bug-when-firmware-download-timeout.patch
+gpio-pca953x-fix-irq_stat-not-updated-when-irq-is-disabled-irq_mask-not-set.patch
+hwmon-adt7470-fix-warning-on-module-removal.patch
+asoc-dmaengine-restore-null-prepare_slave_config-callback.patch
+net-mlx5e-fix-trust-state-reset-in-reload.patch
+net-mlx5e-don-t-match-double-vlan-packets-if-cvlan-is-not-set.patch
+net-mlx5e-ct-fix-queued-up-restore-put-executing-after-relevant-ft-release.patch
+net-mlx5e-fix-the-calling-of-update_buffer_lossy-api.patch
+net-mlx5-avoid-double-clear-or-set-of-sync-reset-requested.patch
+selftests-seccomp-don-t-call-read-on-tty-from-background-pgrp.patch
+rdma-siw-fix-a-condition-race-issue-in-mpa-request-processing.patch
+nfsv4-don-t-invalidate-inode-attributes-on-delegation-return.patch