From 14eaefac0bc311488e8fcae4d14cc457c6992249 Mon Sep 17 00:00:00 2001 From: ZhaoLong Wang Date: Tue, 30 Jan 2024 14:35:57 +0800 Subject: [PATCH 1/3] exportfs: kabi: Reserve KABI slots for export_operations structure 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 --- 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 +#include 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, -- Gitee From bea34bb215d909f8c7ad8f17998d8c5e9bc1be6b Mon Sep 17 00:00:00 2001 From: ZhaoLong Wang Date: Tue, 30 Jan 2024 14:35:58 +0800 Subject: [PATCH 2/3] pipe: kabi: Reserve KABI slots for pipe_inode_info structure 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 --- 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 + #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) }; /* -- Gitee From 81f7f59578703e79eb6f81df0eec92e7771c82c8 Mon Sep 17 00:00:00 2001 From: ZhaoLong Wang Date: Tue, 30 Jan 2024 14:35:59 +0800 Subject: [PATCH 3/3] mtd: kabi: Reserve KABI slots for mtd_device_xxx_register() related structures 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 --- 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 #include #include +#include #include @@ -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 - +#include /* * 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) }; -- Gitee