Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1578910
| From | Jess Frazelle <me@jessfraz.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v2 5/5] x86: set msi_domain_ops as __ro_after_init |
| Date | 2017-02-11 02:40 +0100 |
| Message-ID | <t9uPo-2IM-13@gated-at.bofh.it> (permalink) |
| References | <t9uPn-2IM-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Marked msi_domain_ops structs as __ro_after_init when called only during init.
This protects the data structure from accidental corruption.
Suggested-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Jess Frazelle <me@jessfraz.com>
---
arch/x86/kernel/apic/msi.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kernel/apic/msi.c b/arch/x86/kernel/apic/msi.c
index 015bbf30e3e3..27783a1e7166 100644
--- a/arch/x86/kernel/apic/msi.c
+++ b/arch/x86/kernel/apic/msi.c
@@ -121,7 +121,7 @@ void pci_msi_set_desc(msi_alloc_info_t *arg, struct msi_desc *desc)
}
EXPORT_SYMBOL_GPL(pci_msi_set_desc);
-static struct msi_domain_ops pci_msi_domain_ops = {
+static struct msi_domain_ops pci_msi_domain_ops __ro_after_init = {
.get_hwirq = pci_msi_get_hwirq,
.msi_prepare = pci_msi_prepare,
.set_desc = pci_msi_set_desc,
@@ -207,7 +207,7 @@ static int dmar_msi_init(struct irq_domain *domain,
return 0;
}
-static struct msi_domain_ops dmar_msi_domain_ops = {
+static struct msi_domain_ops dmar_msi_domain_ops __ro_after_init = {
.get_hwirq = dmar_msi_get_hwirq,
.msi_init = dmar_msi_init,
};
@@ -304,7 +304,7 @@ static void hpet_msi_free(struct irq_domain *domain,
irq_clear_status_flags(virq, IRQ_MOVE_PCNTXT);
}
-static struct msi_domain_ops hpet_msi_domain_ops = {
+static struct msi_domain_ops hpet_msi_domain_ops __ro_after_init = {
.get_hwirq = hpet_msi_get_hwirq,
.msi_init = hpet_msi_init,
.msi_free = hpet_msi_free,
--
2.11.0
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v2 1/5] irq: set {msi_domain,syscore}_ops as __ro_after_init Jess Frazelle <me@jessfraz.com> - 2017-02-11 02:40 +0100
[PATCH v2 5/5] x86: set msi_domain_ops as __ro_after_init Jess Frazelle <me@jessfraz.com> - 2017-02-11 02:40 +0100
[PATCH v2 3/5] pci: set msi_domain_ops as __ro_after_init Jess Frazelle <me@jessfraz.com> - 2017-02-11 02:40 +0100
RE: [PATCH v2 3/5] pci: set msi_domain_ops as __ro_after_init KY Srinivasan <kys@microsoft.com> - 2017-02-12 05:10 +0100
Re: [PATCH v2 3/5] pci: set msi_domain_ops as __ro_after_init Keith Busch <keith.busch@intel.com> - 2017-02-13 19:10 +0100
Re: [PATCH v2 1/5] irq: set {msi_domain,syscore}_ops as __ro_after_init Thomas Gleixner <tglx@linutronix.de> - 2017-02-11 10:20 +0100
Re: [PATCH v2 1/5] irq: set {msi_domain,syscore}_ops as __ro_after_init Thomas Gleixner <tglx@linutronix.de> - 2017-02-11 10:30 +0100
Re: [PATCH v2 1/5] irq: set {msi_domain,syscore}_ops as __ro_after_init Jess Frazelle <me@jessfraz.com> - 2017-02-11 11:50 +0100
Re: [PATCH v2 1/5] irq: set {msi_domain,syscore}_ops as __ro_after_init Thomas Gleixner <tglx@linutronix.de> - 2017-02-11 13:10 +0100
Re: [PATCH v2 1/5] irq: set {msi_domain,syscore}_ops as __ro_after_init Jessica Frazelle <me@jessfraz.com> - 2017-02-11 13:20 +0100
csiph-web