[PATCH OLK-6.6 0/3] reserve KABI slots for file system or storage related structures

Reserve kabi slots for the following structures: - export_operations - pipe_inode_info - mtd_info - mtd_part_parser_data - mtd_partition ZhaoLong Wang (3): exportfs: kabi: Reserve KABI slots for export_operations structure pipe: kabi: Reserve KABI slots for pipe_inode_info structure mtd: kabi: Reserve KABI slots for mtd_device_xxx_register() related structures include/linux/exportfs.h | 3 +++ include/linux/mtd/mtd.h | 3 +++ include/linux/mtd/partitions.h | 6 +++++- include/linux/pipe_fs_i.h | 4 ++++ 4 files changed, 15 insertions(+), 1 deletion(-) -- 2.34.3

hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I8ZSV8 -------------------------------- export_operations is a structure for registering callback methods and has changed since version 5.10. Reserve two KABI slots for export_operations by referring to the policy of version 5.10. Signed-off-by: ZhaoLong Wang <wangzhaolong1@huawei.com> --- include/linux/exportfs.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h index 11fbd0ee1370..ddc3da097362 100644 --- a/include/linux/exportfs.h +++ b/include/linux/exportfs.h @@ -3,6 +3,7 @@ #define LINUX_EXPORTFS_H 1 #include <linux/types.h> +#include <linux/kabi.h> struct dentry; struct iattr; @@ -225,6 +226,8 @@ struct export_operations { */ #define EXPORT_OP_FLUSH_ON_CLOSE (0x20) /* fs flushes file data on close */ unsigned long flags; + KABI_RESERVE(1) + KABI_RESERVE(2) }; extern int exportfs_encode_inode_fh(struct inode *inode, struct fid *fid, -- 2.34.3

hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I8ZTLZ -------------------------------- pipe_inode_info is a structure widely used in the kernel and occupies 168 bytes. In the three cache lines, two KABI slots can be reserved for future expansion. Signed-off-by: ZhaoLong Wang <wangzhaolong1@huawei.com> --- include/linux/pipe_fs_i.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h index 608a9eb86bff..ec52f38f7202 100644 --- a/include/linux/pipe_fs_i.h +++ b/include/linux/pipe_fs_i.h @@ -2,6 +2,8 @@ #ifndef _LINUX_PIPE_FS_I_H #define _LINUX_PIPE_FS_I_H +#include <linux/kabi.h> + #define PIPE_DEF_BUFFERS 16 #define PIPE_BUF_FLAG_LRU 0x01 /* page is on the LRU */ @@ -80,6 +82,8 @@ struct pipe_inode_info { #ifdef CONFIG_WATCH_QUEUE struct watch_queue *watch_queue; #endif + KABI_RESERVE(1) + KABI_RESERVE(2) }; /* -- 2.34.3

hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I8ZUFD -------------------------------- The mtd_device_parse_register() and mtd_device_unregister() APIs are in the kabi trustlist. The involved structures are 'struct mtd_info', 'struct mtd_part_parser_data', and 'struct mtd_partition'. These structures may still be changed. To prevent KABI incompatibility caused by CVE fixes in the future, these structures are reserved. mtd_info: Important structure with a size of 1408 bytes. In the 22 cache lines, two KABI slots can be reserved for future expansion. mtd_partition: Important structure with a size of 48 bytes. In 1 cache line space, two KABI slots can be reserved for future expansion. mtd_part_parser_data: The size is 8 bytes. Two KABI slots can be reserved for future expansion. Signed-off-by: ZhaoLong Wang <wangzhaolong1@huawei.com> --- include/linux/mtd/mtd.h | 3 +++ include/linux/mtd/partitions.h | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 914a9f974baa..ef0eac5b9aec 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h @@ -13,6 +13,7 @@ #include <linux/device.h> #include <linux/of.h> #include <linux/nvmem-provider.h> +#include <linux/kabi.h> #include <mtd/mtd-abi.h> @@ -398,6 +399,8 @@ struct mtd_info { struct mtd_part part; struct mtd_master master; + KABI_RESERVE(0) + KABI_RESERVE(1) }; static inline struct mtd_info *mtd_get_master(struct mtd_info *mtd) diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h index b74a539ec581..aa09e780a77b 100644 --- a/include/linux/mtd/partitions.h +++ b/include/linux/mtd/partitions.h @@ -10,7 +10,7 @@ #define MTD_PARTITIONS_H #include <linux/types.h> - +#include <linux/kabi.h> /* * Partition definition structure: @@ -51,6 +51,8 @@ struct mtd_partition { uint32_t mask_flags; /* master MTD flags to mask out for this partition */ uint32_t add_flags; /* flags to add to the partition */ struct device_node *of_node; + KABI_RESERVE(0) + KABI_RESERVE(1) }; #define MTDPART_OFS_RETAIN (-3) @@ -68,6 +70,8 @@ struct device_node; */ struct mtd_part_parser_data { unsigned long origin; + KABI_RESERVE(0) + KABI_RESERVE(1) }; -- 2.34.3

反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/4337 邮件列表地址:https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/3... FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/4337 Mailing list address: https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/3...
participants (2)
-
patchwork bot
-
ZhaoLong Wang