Radu Rendec
78e7b15e17
powerpc/msi: Fix NULL pointer access in teardown code
...
The arch_teardown_msi_irqs() function assumes that controller ops
pointers were already checked in arch_setup_msi_irqs(), but this
assumption is wrong: arch_teardown_msi_irqs() can be called even when
arch_setup_msi_irqs() returns an error (-ENOSYS).
This can happen in the following scenario:
- msi_capability_init() calls pci_msi_setup_msi_irqs()
- pci_msi_setup_msi_irqs() returns -ENOSYS
- msi_capability_init() notices the error and calls free_msi_irqs()
- free_msi_irqs() calls pci_msi_teardown_msi_irqs()
This is easier to see when CONFIG_PCI_MSI_IRQ_DOMAIN is not set and
pci_msi_setup_msi_irqs() and pci_msi_teardown_msi_irqs() are just
aliases to arch_setup_msi_irqs() and arch_teardown_msi_irqs().
The call to free_msi_irqs() upon pci_msi_setup_msi_irqs() failure
seems legit, as it does additional cleanup; e.g.
list_del(&entry->list) and kfree(entry) inside free_msi_irqs() do
happen (MSI descriptors are allocated before pci_msi_setup_msi_irqs()
is called and need to be cleaned up if that fails).
Fixes: 6b2fd7efeb
("PCI/MSI/PPC: Remove arch_msi_check_device()")
Cc: stable@vger.kernel.org # v3.18+
Signed-off-by: Radu Rendec <radu.rendec@gmail.com >
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au >
2018-11-29 23:49:11 +11:00
..
2018-10-20 13:26:47 +11:00
2018-09-14 13:47:31 +10:00
2018-09-14 13:47:31 +10:00
2018-06-03 21:19:40 +10:00
2018-10-26 14:36:21 -07:00
2017-11-02 11:10:55 +01:00
2018-10-14 18:04:09 +11:00
2018-10-13 22:21:25 +11:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-07-30 22:48:17 +10:00
2018-03-24 00:38:51 +11:00
2018-10-09 16:04:27 +11:00
2018-07-19 14:37:57 +10:00
2018-10-14 18:04:09 +11:00
2018-07-30 22:47:53 +10:00
2017-04-13 23:34:33 +10:00
2018-01-10 16:41:14 +01:00
2018-10-19 08:43:46 +02:00
2018-07-30 15:58:01 -05:00
2018-10-31 08:54:15 -07:00
2018-03-27 23:44:58 +11:00
2018-10-13 22:21:25 +11:00
2018-10-13 22:21:25 +11:00
2018-03-27 23:44:58 +11:00
2018-10-13 22:21:25 +11:00
2018-01-27 20:02:52 +11:00
2018-10-13 22:21:25 +11:00
2018-10-03 15:40:01 +10:00
2018-10-14 18:04:09 +11:00
2016-08-07 23:50:09 -04:00
2018-07-30 22:48:17 +10:00
2018-10-14 18:04:09 +11:00
2018-09-19 22:08:12 +10:00
2018-07-30 22:48:17 +10:00
2017-11-02 11:10:55 +01:00
2018-10-26 21:58:58 +11:00
2018-07-30 22:48:17 +10:00
2018-07-30 22:48:13 +10:00
2016-08-07 23:50:09 -04:00
2018-07-30 22:48:17 +10:00
2017-11-02 11:10:55 +01:00
2018-07-30 22:48:17 +10:00
2018-06-26 09:07:55 +02:00
2018-07-30 22:48:17 +10:00
2018-07-24 22:03:14 +10:00
2018-08-13 15:59:06 +10:00
2018-07-30 22:48:17 +10:00
2018-08-14 15:36:02 +10:00
2016-12-20 09:48:44 -08:00
2018-10-14 18:04:09 +11:00
2018-04-05 14:59:26 +10:00
2018-10-26 14:36:21 -07:00
2018-08-07 21:49:24 +10:00
2018-10-14 18:04:09 +11:00
2018-04-13 17:10:28 -07:00
2018-10-20 13:26:47 +11:00
2018-06-21 12:33:19 +02:00
2018-06-21 12:33:19 +02:00
2018-07-30 22:48:16 +10:00
2018-05-17 14:12:40 +10:00
2018-07-30 22:48:17 +10:00
2017-11-02 11:10:55 +01:00
2018-05-10 23:25:08 +10:00
2018-08-10 22:12:36 +10:00
2018-07-30 22:47:53 +10:00
2018-10-19 00:56:17 +11:00
2018-10-04 23:16:53 +10:00
2018-09-19 21:59:22 +10:00
2018-07-30 22:48:17 +10:00
2018-07-30 22:48:17 +10:00
2018-06-04 00:39:17 +10:00
2018-05-25 12:04:38 +10:00
2018-10-20 13:26:47 +11:00
2018-10-20 13:26:47 +11:00
2017-12-11 13:03:35 +11:00
2018-11-29 23:49:11 +11:00
2018-06-03 20:40:24 +10:00
2017-08-23 22:27:04 +10:00
2018-01-19 22:37:01 +11:00
2017-11-12 23:51:41 +11:00
2018-10-31 08:54:16 -07:00
2018-10-31 08:54:16 -07:00
2018-10-14 18:04:09 +11:00
2017-12-11 13:03:35 +11:00
2018-02-06 09:59:40 -08:00
2018-08-17 11:32:50 -07:00
2017-12-18 23:05:52 -06:00
2018-07-30 22:48:16 +10:00
2018-01-22 05:48:33 +11:00
2018-11-02 09:19:35 -07:00
2018-10-19 00:56:17 +11:00
2018-10-19 00:56:17 +11:00
2017-11-02 11:10:55 +01:00
2018-10-31 08:54:15 -07:00
2016-12-24 11:46:01 -08:00
2018-10-14 18:04:09 +11:00
2017-08-31 14:26:47 +10:00
2018-01-22 05:48:33 +11:00
2017-08-31 14:26:40 +10:00
2018-06-07 10:23:33 -07:00
2018-06-03 20:43:33 +10:00
2018-10-13 22:21:25 +11:00
2018-10-19 00:56:17 +11:00
2018-08-08 00:32:26 +10:00
2018-10-31 08:54:15 -07:00
2018-11-15 14:48:43 +11:00
2018-10-31 08:54:16 -07:00
2018-05-25 12:04:43 +10:00
2018-06-25 23:21:13 +09:00
2018-06-25 23:21:13 +09:00
2018-06-22 19:04:22 +02:00
2018-05-10 23:25:13 +10:00
2017-11-02 11:10:55 +01:00
2018-10-21 19:32:00 +11:00
2018-06-19 23:03:50 +10:00
2018-07-30 22:48:17 +10:00
2017-03-02 08:42:30 +01:00
2018-10-14 18:04:09 +11:00
2017-11-02 11:10:55 +01:00
2017-03-20 19:02:49 +11:00
2018-05-10 23:25:15 +10:00
2018-06-25 23:21:13 +09:00
2018-03-31 09:09:36 +11:00
2018-05-10 23:25:14 +10:00
2018-05-10 23:25:16 +10:00
2018-05-10 23:25:14 +10:00
2018-05-25 12:04:44 +10:00
2018-10-20 13:26:47 +11:00
2018-10-09 16:51:05 +11:00
2018-10-26 14:36:21 -07:00
2017-08-24 16:19:21 +10:00
2018-07-30 22:47:54 +10:00
2018-05-25 12:04:46 +10:00
2018-07-30 22:48:16 +10:00
2018-10-26 14:36:21 -07:00
2018-07-24 22:03:14 +10:00