hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4JBL0 CVE: NA
------------------------------
Add KABI_AUX_PTR extenstions to the following base structures before KABI freeze:
struct device_driver struct class struct device struct hrtimer struct ipmi_smi_handlers struct net_device
Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com Reviewed-by: Xie XiuQi xiexiuqi@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- include/linux/device.h | 9 ++++++++- include/linux/device/class.h | 7 +++++++ include/linux/device/driver.h | 7 +++++++ include/linux/hrtimer.h | 7 +++++++ include/linux/ipmi_smi.h | 10 ++++++++++ include/linux/netdevice.h | 7 +++++++ 6 files changed, 46 insertions(+), 1 deletion(-)
diff --git a/include/linux/device.h b/include/linux/device.h index 2e95153942d1..929b66dc5ea9 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -370,6 +370,12 @@ struct dev_links_info { enum dl_dev_state status; };
+/** + * struct device_extended_resvd - KABI extension struct + */ +struct device_extended_resvd { +}; + /** * struct device - The basic device structure * @parent: The device's "parent" device, the device to which it is attached. @@ -560,7 +566,7 @@ struct device { #ifdef CONFIG_DMA_OPS_BYPASS bool dma_ops_bypass : 1; #endif - + /* Use device_extended after all RESERVE fields used */ KABI_RESERVE(1) KABI_RESERVE(2) KABI_RESERVE(3) @@ -577,6 +583,7 @@ struct device { KABI_RESERVE(14) KABI_RESERVE(15) KABI_RESERVE(16) + KABI_AUX_PTR(device_extended) };
/** diff --git a/include/linux/device/class.h b/include/linux/device/class.h index d152ddce543a..f2071ee10d61 100644 --- a/include/linux/device/class.h +++ b/include/linux/device/class.h @@ -24,6 +24,12 @@ struct device; struct fwnode_handle;
+/** + * struct class_resvd - KABI extension struct + */ +struct class_resvd { +}; + /** * struct class - device classes * @name: Name of the class. @@ -82,6 +88,7 @@ struct class { KABI_RESERVE(2) KABI_RESERVE(3) KABI_RESERVE(4) + KABI_AUX_PTR(class) };
struct class_dev_iter { diff --git a/include/linux/device/driver.h b/include/linux/device/driver.h index 9473256006e5..b814f1bd79f6 100644 --- a/include/linux/device/driver.h +++ b/include/linux/device/driver.h @@ -48,6 +48,12 @@ enum probe_type { PROBE_FORCE_SYNCHRONOUS, };
+/** + * struct device_driver_resvd - KABI extension struct + */ +struct device_driver_resvd { +}; + /** * struct device_driver - The basic device driver structure * @name: Name of the device driver. @@ -124,6 +130,7 @@ struct device_driver { KABI_RESERVE(2) KABI_RESERVE(3) KABI_RESERVE(4) + KABI_AUX_PTR(device_driver) };
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 1525853610b0..b1f2e4692e66 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -95,6 +95,12 @@ enum hrtimer_restart { #define HRTIMER_STATE_INACTIVE 0x00 #define HRTIMER_STATE_ENQUEUED 0x01
+/** + * struct hrtimer_resvd - KABI extension struct + */ +struct hrtimer_resvd { +}; + /** * struct hrtimer - the basic hrtimer structure * @node: timerqueue node, which also manages node.expires, @@ -128,6 +134,7 @@ struct hrtimer {
KABI_RESERVE(1) KABI_RESERVE(2) + KABI_AUX_PTR(hrtimer) };
/** diff --git a/include/linux/ipmi_smi.h b/include/linux/ipmi_smi.h index deec18b8944a..99ad621b0350 100644 --- a/include/linux/ipmi_smi.h +++ b/include/linux/ipmi_smi.h @@ -70,6 +70,15 @@ struct ipmi_smi_msg { void (*done)(struct ipmi_smi_msg *msg); };
+/** + * struct ipmi_smi_handlers_resvd - KABI extension struct + * This extension must be dynamically allocated for every instance of + * ipmi_smi_handlers, because ipmi_smi_handlers is embedded in another + * struct. + */ +struct ipmi_smi_handlers_resvd { +}; + struct ipmi_smi_handlers { struct module *owner;
@@ -153,6 +162,7 @@ struct ipmi_smi_handlers { * block. */ void (*set_maintenance_mode)(void *send_info, bool enable); + KABI_AUX_PTR(ipmi_smi_handlers) };
struct ipmi_device_id { diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 1335981945d9..de1fb4ec4d50 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -1639,6 +1639,12 @@ enum netdev_ml_priv_type { ML_PRIV_CAN, };
+/** + * struct net_device_extended_resvd - KABI extension struct + */ +struct net_device_extended_resvd { +}; + /** * struct net_device - The DEVICE structure. * @@ -2215,6 +2221,7 @@ struct net_device { KABI_RESERVE(6) KABI_RESERVE(7) KABI_RESERVE(8) + KABI_AUX_PTR(net_device_extended) }; #define to_net_dev(d) container_of(d, struct net_device, dev)