]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Mar 2022 08:00:47 +0000 (09:00 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Mar 2022 08:00:47 +0000 (09:00 +0100)
added patches:
net-dcb-disable-softirqs-in-dcbnl_flush_dev.patch

queue-4.14/net-dcb-disable-softirqs-in-dcbnl_flush_dev.patch [new file with mode: 0644]
queue-4.14/series

diff --git a/queue-4.14/net-dcb-disable-softirqs-in-dcbnl_flush_dev.patch b/queue-4.14/net-dcb-disable-softirqs-in-dcbnl_flush_dev.patch
new file mode 100644 (file)
index 0000000..e17dacf
--- /dev/null
@@ -0,0 +1,57 @@
+From 10b6bb62ae1a49ee818fc479cf57b8900176773e Mon Sep 17 00:00:00 2001
+From: Vladimir Oltean <vladimir.oltean@nxp.com>
+Date: Wed, 2 Mar 2022 21:39:39 +0200
+Subject: net: dcb: disable softirqs in dcbnl_flush_dev()
+
+From: Vladimir Oltean <vladimir.oltean@nxp.com>
+
+commit 10b6bb62ae1a49ee818fc479cf57b8900176773e upstream.
+
+Ido Schimmel points out that since commit 52cff74eef5d ("dcbnl : Disable
+software interrupts before taking dcb_lock"), the DCB API can be called
+by drivers from softirq context.
+
+One such in-tree example is the chelsio cxgb4 driver:
+dcb_rpl
+-> cxgb4_dcb_handle_fw_update
+   -> dcb_ieee_setapp
+
+If the firmware for this driver happened to send an event which resulted
+in a call to dcb_ieee_setapp() at the exact same time as another
+DCB-enabled interface was unregistering on the same CPU, the softirq
+would deadlock, because the interrupted process was already holding the
+dcb_lock in dcbnl_flush_dev().
+
+Fix this unlikely event by using spin_lock_bh() in dcbnl_flush_dev() as
+in the rest of the dcbnl code.
+
+Fixes: 91b0383fef06 ("net: dcb: flush lingering app table entries for unregistered devices")
+Reported-by: Ido Schimmel <idosch@idosch.org>
+Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
+Link: https://lore.kernel.org/r/20220302193939.1368823-1-vladimir.oltean@nxp.com
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/dcb/dcbnl.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/net/dcb/dcbnl.c
++++ b/net/dcb/dcbnl.c
+@@ -1943,7 +1943,7 @@ static void dcbnl_flush_dev(struct net_d
+ {
+       struct dcb_app_type *itr, *tmp;
+-      spin_lock(&dcb_lock);
++      spin_lock_bh(&dcb_lock);
+       list_for_each_entry_safe(itr, tmp, &dcb_app_list, list) {
+               if (itr->ifindex == dev->ifindex) {
+@@ -1952,7 +1952,7 @@ static void dcbnl_flush_dev(struct net_d
+               }
+       }
+-      spin_unlock(&dcb_lock);
++      spin_unlock_bh(&dcb_lock);
+ }
+ static int dcbnl_netdevice_event(struct notifier_block *nb,
index f224b5114bb9f85d35fa92fe82428fa4d3ee348e..707768b9ad5b80aff1a132111a5e8951083be709 100644 (file)
@@ -39,3 +39,4 @@ input-elan_i2c-move-regulator_able-out-of-elan_able_power.patch
 input-elan_i2c-fix-regulator-enable-count-imbalance-after-suspend-resume.patch
 hid-add-mapping-for-key_all_applications.patch
 memfd-fix-f_seal_write-after-shmem-huge-page-allocated.patch
+net-dcb-disable-softirqs-in-dcbnl_flush_dev.patch