From: Greg Kroah-Hartman Date: Mon, 7 Mar 2022 08:01:05 +0000 (+0100) Subject: 5.4-stable patches X-Git-Tag: v4.9.305~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5e8cf430e66d70f4ff1c520860a75fef195ee0f7;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: net-dcb-disable-softirqs-in-dcbnl_flush_dev.patch --- diff --git a/queue-5.4/net-dcb-disable-softirqs-in-dcbnl_flush_dev.patch b/queue-5.4/net-dcb-disable-softirqs-in-dcbnl_flush_dev.patch new file mode 100644 index 00000000000..fed320fba9d --- /dev/null +++ b/queue-5.4/net-dcb-disable-softirqs-in-dcbnl_flush_dev.patch @@ -0,0 +1,57 @@ +From 10b6bb62ae1a49ee818fc479cf57b8900176773e Mon Sep 17 00:00:00 2001 +From: Vladimir Oltean +Date: Wed, 2 Mar 2022 21:39:39 +0200 +Subject: net: dcb: disable softirqs in dcbnl_flush_dev() + +From: Vladimir Oltean + +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 +Signed-off-by: Vladimir Oltean +Link: https://lore.kernel.org/r/20220302193939.1368823-1-vladimir.oltean@nxp.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + net/dcb/dcbnl.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/net/dcb/dcbnl.c ++++ b/net/dcb/dcbnl.c +@@ -2067,7 +2067,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) { +@@ -2076,7 +2076,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, diff --git a/queue-5.4/series b/queue-5.4/series index ea71a6d2033..1b6fd7f5c33 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -61,3 +61,4 @@ btrfs-fix-lost-prealloc-extents-beyond-eof-after-full-fsync.patch btrfs-qgroup-fix-deadlock-between-rescan-worker-and-remove-qgroup.patch btrfs-add-missing-run-of-delayed-items-after-unlink-during-log-replay.patch revert-xfrm-xfrm_state_mtu-should-return-at-least-1280-for-ipv6.patch +net-dcb-disable-softirqs-in-dcbnl_flush_dev.patch