From 90edd9003194819a77440267700443850afb4b56 Mon Sep 17 00:00:00 2001 From: Tan Xiaojun Date: Wed, 10 Apr 2019 18:34:55 +0800 Subject: [PATCH] kabi: reserve space for pci subsystem related structure hulk inclusion category: feature bugzilla: 13276 CVE: NA ------------------------------- Reserve space for the structure in pci subsystem. Signed-off-by: Tan Xiaojun Reviewed-by: Xie XiuQi Signed-off-by: Yang Yingliang --- drivers/pci/pci.h | 11 +++++++++++ include/linux/pci.h | 34 ++++++++++++++++++++++++++++++++++ include/linux/pci_hotplug.h | 18 ++++++++++++++++++ 3 files changed, 63 insertions(+) diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 6e0d1528d471..4656f91c5a2e 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h @@ -2,6 +2,8 @@ #ifndef DRIVERS_PCI_H #define DRIVERS_PCI_H +#include + #define PCI_FIND_CAP_TTL 48 #define PCI_VSEC_ID_INTEL_TBT 0x1234 /* Thunderbolt */ @@ -291,6 +293,15 @@ struct pci_sriov { u16 subsystem_device; /* VF subsystem device */ resource_size_t barsz[PCI_SRIOV_NUM_BARS]; /* VF BAR size */ bool drivers_autoprobe; /* Auto probing of VFs by driver */ + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) + KABI_RESERVE(5) + KABI_RESERVE(6) + KABI_RESERVE(7) + KABI_RESERVE(8) }; /* pci_dev priv_flags */ diff --git a/include/linux/pci.h b/include/linux/pci.h index 15d27ef98076..c7f62371c94a 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -20,6 +20,7 @@ #include +#include #include #include #include @@ -447,6 +448,22 @@ struct pci_dev { char *driver_override; /* Driver name to force a match */ unsigned long priv_flags; /* Private flags for the PCI driver */ + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) + KABI_RESERVE(5) + KABI_RESERVE(6) + KABI_RESERVE(7) + KABI_RESERVE(8) + KABI_RESERVE(9) + KABI_RESERVE(10) + KABI_RESERVE(11) + KABI_RESERVE(12) + KABI_RESERVE(13) + KABI_RESERVE(14) + KABI_RESERVE(15) }; static inline struct pci_dev *pci_physfn(struct pci_dev *dev) @@ -577,6 +594,14 @@ struct pci_bus { struct bin_attribute *legacy_io; /* Legacy I/O for this bus */ struct bin_attribute *legacy_mem; /* Legacy mem */ unsigned int is_added:1; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) + KABI_RESERVE(5) + KABI_RESERVE(6) + KABI_RESERVE(7) }; #define to_pci_bus(n) container_of(n, struct pci_bus, dev) @@ -768,6 +793,15 @@ struct pci_driver { const struct attribute_group **groups; struct device_driver driver; struct pci_dynids dynids; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) + KABI_RESERVE(5) + KABI_RESERVE(6) + KABI_RESERVE(7) + KABI_RESERVE(8) }; #define to_pci_driver(drv) container_of(drv, struct pci_driver, driver) diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h index a6d6650a0490..63714ff072c4 100644 --- a/include/linux/pci_hotplug.h +++ b/include/linux/pci_hotplug.h @@ -57,6 +57,15 @@ struct hotplug_slot_ops { int (*get_latch_status) (struct hotplug_slot *slot, u8 *value); int (*get_adapter_status) (struct hotplug_slot *slot, u8 *value); int (*reset_slot) (struct hotplug_slot *slot, int probe); + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) + KABI_RESERVE(5) + KABI_RESERVE(6) + KABI_RESERVE(7) + KABI_RESERVE(8) }; /** @@ -91,6 +100,15 @@ struct hotplug_slot { /* Variables below this are for use only by the hotplug pci core. */ struct list_head slot_list; struct pci_slot *pci_slot; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) + KABI_RESERVE(5) + KABI_RESERVE(6) + KABI_RESERVE(7) + KABI_RESERVE(8) }; static inline const char *hotplug_slot_name(const struct hotplug_slot *slot) -- GitLab