From d93099c0d37b298ce3685c7db11b94308eb92f39 Mon Sep 17 00:00:00 2001 From: Tan Xiaojun Date: Fri, 31 Dec 2021 15:59:15 +0800 Subject: [PATCH] kabi: reserve space for pci subsystem related structure hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4JBL0 CVE: NA ------------------------------- Reserve space for the structure in pci subsystem. Signed-off-by: Tan Xiaojun Reviewed-by: Xie XiuQi Signed-off-by: Yang Yingliang Signed-off-by: Jialin Zhang Reviewed-by: wangxiongfeng 00379786 Reviewed-by: Yang Yingliang Signed-off-by: Zheng Zengkai --- drivers/pci/pci.h | 9 +++++++++ include/linux/pci.h | 34 ++++++++++++++++++++++++++++++++++ include/linux/pci_hotplug.h | 18 ++++++++++++++++++ 3 files changed, 61 insertions(+) diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index a96dc6f53076..9a4e34814005 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h @@ -343,6 +343,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) }; /** diff --git a/include/linux/pci.h b/include/linux/pci.h index 7d4e52256e3a..ff6236a3dd6b 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -26,6 +26,7 @@ #include +#include #include #include #include @@ -509,6 +510,22 @@ struct pci_dev { */ unsigned long slot_being_removed_rescanned; struct pci_dev *rpdev; /* root port pci_dev */ + + 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) @@ -646,6 +663,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) @@ -879,6 +904,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 b482e42d7153..4eec239ff689 100644 --- a/include/linux/pci_hotplug.h +++ b/include/linux/pci_hotplug.h @@ -45,6 +45,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) }; /** @@ -61,6 +70,15 @@ struct hotplug_slot { struct pci_slot *pci_slot; struct module *owner; const char *mod_name; + + 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