From: Greg Kroah-Hartman Date: Mon, 3 Aug 2020 10:09:46 +0000 (+0200) Subject: 4.4-stable patches X-Git-Tag: v5.7.13~16 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ed06aa099badea98c1263982d5ff51125a6379c5;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: x86-i8259-use-printk_deferred-to-prevent-deadlock.patch --- diff --git a/queue-4.4/series b/queue-4.4/series index 220a53e5534..fe1c10783f6 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -29,3 +29,4 @@ nfc-s3fwrn5-add-missing-release-on-skb-in-s3fwrn5_re.patch net-ethernet-ravb-exit-if-re-initialization-fails-in.patch revert-i2c-cadence-fix-the-hold-bit-setting.patch xen-netfront-fix-potential-deadlock-in-xennet_remove.patch +x86-i8259-use-printk_deferred-to-prevent-deadlock.patch diff --git a/queue-4.4/x86-i8259-use-printk_deferred-to-prevent-deadlock.patch b/queue-4.4/x86-i8259-use-printk_deferred-to-prevent-deadlock.patch new file mode 100644 index 00000000000..fd41b78b4a8 --- /dev/null +++ b/queue-4.4/x86-i8259-use-printk_deferred-to-prevent-deadlock.patch @@ -0,0 +1,51 @@ +From bdd65589593edd79b6a12ce86b3b7a7c6dae5208 Mon Sep 17 00:00:00 2001 +From: Thomas Gleixner +Date: Wed, 29 Jul 2020 10:53:28 +0200 +Subject: x86/i8259: Use printk_deferred() to prevent deadlock + +From: Thomas Gleixner + +commit bdd65589593edd79b6a12ce86b3b7a7c6dae5208 upstream. + +0day reported a possible circular locking dependency: + +Chain exists of: + &irq_desc_lock_class --> console_owner --> &port_lock_key + + Possible unsafe locking scenario: + + CPU0 CPU1 + ---- ---- + lock(&port_lock_key); + lock(console_owner); + lock(&port_lock_key); + lock(&irq_desc_lock_class); + +The reason for this is a printk() in the i8259 interrupt chip driver +which is invoked with the irq descriptor lock held, which reverses the +lock operations vs. printk() from arbitrary contexts. + +Switch the printk() to printk_deferred() to avoid that. + +Reported-by: kernel test robot +Signed-off-by: Thomas Gleixner +Signed-off-by: Ingo Molnar +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/87365abt2v.fsf@nanos.tec.linutronix.de +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/kernel/i8259.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/x86/kernel/i8259.c ++++ b/arch/x86/kernel/i8259.c +@@ -204,7 +204,7 @@ spurious_8259A_irq: + * lets ACK and report it. [once per IRQ] + */ + if (!(spurious_irq_mask & irqmask)) { +- printk(KERN_DEBUG ++ printk_deferred(KERN_DEBUG + "spurious 8259A interrupt: IRQ%d.\n", irq); + spurious_irq_mask |= irqmask; + } diff --git a/queue-4.4/xen-netfront-fix-potential-deadlock-in-xennet_remove.patch b/queue-4.4/xen-netfront-fix-potential-deadlock-in-xennet_remove.patch index 4f236deed5e..7233e0f757e 100644 --- a/queue-4.4/xen-netfront-fix-potential-deadlock-in-xennet_remove.patch +++ b/queue-4.4/xen-netfront-fix-potential-deadlock-in-xennet_remove.patch @@ -31,14 +31,12 @@ Signed-off-by: Andrea Righi Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- - drivers/net/xen-netfront.c | 64 +++++++++++++++++++++++++------------- + drivers/net/xen-netfront.c | 64 +++++++++++++++++++++++++++++---------------- 1 file changed, 42 insertions(+), 22 deletions(-) -diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c -index 02b6a6c108400..7d4c0c46a889d 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c -@@ -62,6 +62,8 @@ module_param_named(max_queues, xennet_max_queues, uint, 0644); +@@ -62,6 +62,8 @@ module_param_named(max_queues, xennet_ma MODULE_PARM_DESC(max_queues, "Maximum number of queues per virtual interface"); @@ -47,7 +45,7 @@ index 02b6a6c108400..7d4c0c46a889d 100644 static const struct ethtool_ops xennet_ethtool_ops; struct netfront_cb { -@@ -1349,12 +1351,15 @@ static struct net_device *xennet_create_dev(struct xenbus_device *dev) +@@ -1349,12 +1351,15 @@ static struct net_device *xennet_create_ netif_carrier_off(netdev); @@ -69,7 +67,7 @@ index 02b6a6c108400..7d4c0c46a889d 100644 return netdev; exit: -@@ -2166,28 +2171,43 @@ static const struct attribute_group xennet_dev_group = { +@@ -2166,28 +2171,43 @@ static const struct attribute_group xenn }; #endif /* CONFIG_SYSFS */ @@ -100,10 +98,10 @@ index 02b6a6c108400..7d4c0c46a889d 100644 + XenbusStateUnknown, + XENNET_TIMEOUT); + } while (!ret); -+ + + if (xenbus_read_driver_state(dev->otherend) == XenbusStateClosed) + return; - ++ + do { xenbus_switch_state(dev, XenbusStateClosed); - wait_event(module_wq, @@ -129,6 +127,3 @@ index 02b6a6c108400..7d4c0c46a889d 100644 xennet_disconnect_backend(info); if (info->netdev->reg_state == NETREG_REGISTERED) --- -2.25.1 -