Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2018-08-03 14:22:58 +0200
committerHannes Reinecke <hare@suse.de>2018-08-03 14:22:58 +0200
commit9178bf4347599007cfe4d8b5d910df397de0744d (patch)
tree14d7449a9e9a87cf9e63fa0f187f10ac624e55ee
parent23b40eca6fc7df3a8ab9d7ad66e2f0422eae41b1 (diff)
genirq: Check __free_irq() return value for NULL (bsc#1103517).
-rw-r--r--patches.fixes/genirq-Check-__free_irq-return-value-for-NULL.patch40
-rw-r--r--series.conf1
2 files changed, 41 insertions, 0 deletions
diff --git a/patches.fixes/genirq-Check-__free_irq-return-value-for-NULL.patch b/patches.fixes/genirq-Check-__free_irq-return-value-for-NULL.patch
new file mode 100644
index 0000000000..0fa117dc95
--- /dev/null
+++ b/patches.fixes/genirq-Check-__free_irq-return-value-for-NULL.patch
@@ -0,0 +1,40 @@
+From: Alexandru Moise <00moses.alexander00@gmail.com>
+Date: Tue, 19 Sep 2017 22:04:12 +0200
+Subject: [PATCH] genirq: Check __free_irq() return value for NULL
+References: bsc#1103517
+Git-commit: 2827a418ca1b23e432e62c9b3d0e7cf3255dfe88
+Patch-mainline: v4.14-rc3
+
+__free_irq() can return a NULL irqaction for example when trying to free
+already-free IRQ, but the callsite unconditionally dereferences the
+returned pointer.
+
+Fix this by adding a check and return NULL.
+
+Signed-off-by: Alexandru Moise <00moses.alexander00@gmail.com>
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Link: https://lkml.kernel.org/r/20170919200412.GA29985@gmail.com
+
+Signed-off-by: Hannes Reinecke <hare@suse.de>
+---
+ kernel/irq/manage.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
+index 6567d04262d4..c16c9fd151ff 100644
+--- a/kernel/irq/manage.c
++++ b/kernel/irq/manage.c
+@@ -1623,6 +1623,10 @@ const void *free_irq(unsigned int irq, void *dev_id)
+ #endif
+
+ action = __free_irq(irq, dev_id);
++
++ if (!action)
++ return NULL;
++
+ devname = action->name;
+ kfree(action);
+ return devname;
+--
+2.12.3
+
diff --git a/series.conf b/series.conf
index ad28bd2166..4146bb687f 100644
--- a/series.conf
+++ b/series.conf
@@ -6976,6 +6976,7 @@
patches.fixes/scsi-ILLEGAL-REQUEST-ASC-27-target-failure.patch
patches.suse/objtool-Skip-unreachable-warnings-for-GCC-4.4-and-ol.patch
patches.suse/objtool-Support-unoptimized-frame-pointer-setup.patch
+ patches.fixes/genirq-Check-__free_irq-return-value-for-NULL.patch
patches.fixes/irq-generic-chip-Don-t-replace-domain-s-name.patch
patches.fixes/0001-futex-Fix-pi_state-owner-serialization.patch
patches.suse/0001-locking-rwsem-xadd-Fix-missed-wakeup-due-to-reorderi.patch