]> git.proxmox.com Git - pve-kernel.git/blame - patches/kernel/0078-ACPI-APEI-remove-the-unused-dead-code-for-SEA-NMI-no.patch
revert buggy SCSI error handler commit
[pve-kernel.git] / patches / kernel / 0078-ACPI-APEI-remove-the-unused-dead-code-for-SEA-NMI-no.patch
CommitLineData
321d628a
FG
1From 8edefc098e2ff088d8c22d034bf8a5adf76b7295 Mon Sep 17 00:00:00 2001
2From: Dongjiu Geng <gengdongjiu@huawei.com>
3Date: Tue, 17 Oct 2017 16:02:20 +0800
633c5ed1 4Subject: [PATCH 078/242] ACPI / APEI: remove the unused dead-code for SEA/NMI
321d628a
FG
5 notification type
6MIME-Version: 1.0
7Content-Type: text/plain; charset=UTF-8
8Content-Transfer-Encoding: 8bit
9
10CVE-2017-5754
11
12For the SEA notification, the two functions ghes_sea_add() and
13ghes_sea_remove() are only called when CONFIG_ACPI_APEI_SEA
14is defined. If not, it will return errors in the ghes_probe()
15and not continue. If the probe is failed, the ghes_sea_remove()
16also has no chance to be called. Hence, remove the unnecessary
17handling when CONFIG_ACPI_APEI_SEA is not defined.
18
19For the NMI notification, it has the same issue as SEA notification,
20so also remove the unused dead-code for it.
21
22Signed-off-by: Dongjiu Geng <gengdongjiu@huawei.com>
23Tested-by: Tyler Baicar <tbaicar@codeaurora.org>
24Reviewed-by: Borislav Petkov <bp@suse.de>
25Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
26(cherry picked from commit c49870e89f4d2c21c76ebe90568246bb0f3572b7)
27Signed-off-by: Andy Whitcroft <apw@canonical.com>
28Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
29(cherry picked from commit 55f73c32ba6438e8886f348722d2b25aef129d40)
30Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
31---
32 drivers/acpi/apei/ghes.c | 33 +++++----------------------------
33 1 file changed, 5 insertions(+), 28 deletions(-)
34
35diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
36index 3628078ee351..4827176f838d 100644
37--- a/drivers/acpi/apei/ghes.c
38+++ b/drivers/acpi/apei/ghes.c
39@@ -850,17 +850,8 @@ static void ghes_sea_remove(struct ghes *ghes)
40 synchronize_rcu();
41 }
42 #else /* CONFIG_ACPI_APEI_SEA */
43-static inline void ghes_sea_add(struct ghes *ghes)
44-{
45- pr_err(GHES_PFX "ID: %d, trying to add SEA notification which is not supported\n",
46- ghes->generic->header.source_id);
47-}
48-
49-static inline void ghes_sea_remove(struct ghes *ghes)
50-{
51- pr_err(GHES_PFX "ID: %d, trying to remove SEA notification which is not supported\n",
52- ghes->generic->header.source_id);
53-}
54+static inline void ghes_sea_add(struct ghes *ghes) { }
55+static inline void ghes_sea_remove(struct ghes *ghes) { }
56 #endif /* CONFIG_ACPI_APEI_SEA */
57
58 #ifdef CONFIG_HAVE_ACPI_APEI_NMI
59@@ -1062,23 +1053,9 @@ static void ghes_nmi_init_cxt(void)
60 init_irq_work(&ghes_proc_irq_work, ghes_proc_in_irq);
61 }
62 #else /* CONFIG_HAVE_ACPI_APEI_NMI */
63-static inline void ghes_nmi_add(struct ghes *ghes)
64-{
65- pr_err(GHES_PFX "ID: %d, trying to add NMI notification which is not supported!\n",
66- ghes->generic->header.source_id);
67- BUG();
68-}
69-
70-static inline void ghes_nmi_remove(struct ghes *ghes)
71-{
72- pr_err(GHES_PFX "ID: %d, trying to remove NMI notification which is not supported!\n",
73- ghes->generic->header.source_id);
74- BUG();
75-}
76-
77-static inline void ghes_nmi_init_cxt(void)
78-{
79-}
80+static inline void ghes_nmi_add(struct ghes *ghes) { }
81+static inline void ghes_nmi_remove(struct ghes *ghes) { }
82+static inline void ghes_nmi_init_cxt(void) { }
83 #endif /* CONFIG_HAVE_ACPI_APEI_NMI */
84
85 static int ghes_probe(struct platform_device *ghes_dev)
86--
872.14.2
88