Reserve kabi slots for the following structures:
- export_operations - pipe_inode_info - mtd_info - mtd_part_parser_data - mtd_partition
V2: pipe_inode_info -- 2 reservations -> 3 reservations mtd_info -- 2 reservations -> 4 reservations mtd_part_parser_data -- 2 reservations -> 3 reservations
V3: The reserved macro index of the kabi starts from 1
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 | 5 +++++ include/linux/mtd/partitions.h | 7 ++++++- include/linux/pipe_fs_i.h | 5 +++++ 4 files changed, 19 insertions(+), 1 deletion(-)
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,
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, three KABI slots can be reserved for future expansion.
Signed-off-by: ZhaoLong Wang wangzhaolong1@huawei.com --- include/linux/pipe_fs_i.h | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h index 608a9eb86bff..aeab8044717c 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,9 @@ struct pipe_inode_info { #ifdef CONFIG_WATCH_QUEUE struct watch_queue *watch_queue; #endif + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(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 2 slab objects, four 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. Three KABI slots can be reserved for future expansion.
Signed-off-by: ZhaoLong Wang wangzhaolong1@huawei.com --- include/linux/mtd/mtd.h | 5 +++++ include/linux/mtd/partitions.h | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 914a9f974baa..7083a1da7be1 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,10 @@ struct mtd_info {
struct mtd_part part; struct mtd_master master; + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) };
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..9a3a944d6400 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(1) + KABI_RESERVE(2) };
#define MTDPART_OFS_RETAIN (-3) @@ -68,6 +70,9 @@ struct device_node; */ struct mtd_part_parser_data { unsigned long origin; + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) };
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/4343 邮件列表地址:https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/6...
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/4343 Mailing list address: https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/6...