Add KABI slots for fs module struct.
Long Li (8): fscrypt: kabi: Reserve KABI slots for fscrypt_operations struct fanotify: kabi: Reserve KABI slots for fsnotify_* struct kernfs: kabi: Reserve KABI slots for kernfs_* struct xattr: kabi: Reserve KABI slots for xattr_handler struct fs: kabi: Reserve KABI slots for nameidata struct dax: kabi: Reserve KABI slots for dax_* struct profs: kabi: Reserve KABI slots for proc_ops struct sysfs: kabi: Reserve KABI slots for bin_attribute struct
drivers/dax/super.c | 10 ++++++++++ fs/kernfs/file.c | 5 +++++ fs/kernfs/kernfs-internal.h | 7 +++++++ fs/namei.c | 3 +++ include/linux/dax.h | 10 ++++++++++ include/linux/fscrypt.h | 5 +++++ include/linux/fsnotify_backend.h | 15 +++++++++++++++ include/linux/kernfs.h | 10 ++++++++++ include/linux/proc_fs.h | 6 ++++++ include/linux/sysfs.h | 3 +++ include/linux/xattr.h | 5 ++++- 11 files changed, 78 insertions(+), 1 deletion(-)
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I905SE CVE: NA
--------------------------------
Add kabi slots in fscrypt_operations struct for future expansion.
struct size(byte) reserve(8*byte) now(byte) fscrypt_operations 72 3 96
Signed-off-by: Long Li leo.lilong@huawei.com --- include/linux/fscrypt.h | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/include/linux/fscrypt.h b/include/linux/fscrypt.h index c895b12737a1..f4c4a761d078 100644 --- a/include/linux/fscrypt.h +++ b/include/linux/fscrypt.h @@ -13,6 +13,7 @@ #ifndef _LINUX_FSCRYPT_H #define _LINUX_FSCRYPT_H
+#include <linux/kabi.h> #include <linux/fs.h> #include <linux/mm.h> #include <linux/slab.h> @@ -176,6 +177,10 @@ struct fscrypt_operations { */ struct block_device **(*get_devices)(struct super_block *sb, unsigned int *num_devs); + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) };
static inline struct fscrypt_info *fscrypt_get_info(const struct inode *inode)
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I905SE CVE: NA
--------------------------------
Add kabi slots in fsnotify_* struct for future expansion.
struct size(byte) reserve(8*byte) now(byte) fsnotify_ops 48 2 64 fsnotify_event 16 2 32 fsnotify_group 320 8 384
Signed-off-by: Long Li leo.lilong@huawei.com --- include/linux/fsnotify_backend.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h index c0892d75ce33..1e9a590591b1 100644 --- a/include/linux/fsnotify_backend.h +++ b/include/linux/fsnotify_backend.h @@ -10,6 +10,7 @@
#ifdef __KERNEL__
+#include <linux/kabi.h> #include <linux/idr.h> /* inotify uses this */ #include <linux/fs.h> /* struct inode */ #include <linux/list.h> @@ -165,6 +166,9 @@ struct fsnotify_ops { void (*free_event)(struct fsnotify_group *group, struct fsnotify_event *event); /* called on final put+free to free memory */ void (*free_mark)(struct fsnotify_mark *mark); + + KABI_RESERVE(1) + KABI_RESERVE(2) };
/* @@ -174,6 +178,8 @@ struct fsnotify_ops { */ struct fsnotify_event { struct list_head list; + KABI_RESERVE(1) + KABI_RESERVE(2) };
/* @@ -255,6 +261,15 @@ struct fsnotify_group { } fanotify_data; #endif /* CONFIG_FANOTIFY */ }; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) + KABI_RESERVE(5) + KABI_RESERVE(6) + KABI_RESERVE(7) + KABI_RESERVE(8) };
/*
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I905SE CVE: NA
--------------------------------
Add kabi slots in kernfs_* struct for future expansion.
struct size(byte) reserve(8*byte) now(byte) kernfs_syscall_ops 40 3 64 kernfs_root 216 5 256 kernfs_ops 96 4 128 kernfs_open_node 72 3 96
Signed-off-by: Long Li leo.lilong@huawei.com --- fs/kernfs/file.c | 5 +++++ fs/kernfs/kernfs-internal.h | 7 +++++++ include/linux/kernfs.h | 10 ++++++++++ 3 files changed, 22 insertions(+)
diff --git a/fs/kernfs/file.c b/fs/kernfs/file.c index 180906c36f51..443d3b4e2c5d 100644 --- a/fs/kernfs/file.c +++ b/fs/kernfs/file.c @@ -7,6 +7,7 @@ * Copyright (c) 2007, 2013 Tejun Heo tj@kernel.org */
+#include <linux/kabi.h> #include <linux/fs.h> #include <linux/seq_file.h> #include <linux/slab.h> @@ -25,6 +26,10 @@ struct kernfs_open_node { struct list_head files; /* goes through kernfs_open_file.list */ unsigned int nr_mmapped; unsigned int nr_to_release; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) };
/* diff --git a/fs/kernfs/kernfs-internal.h b/fs/kernfs/kernfs-internal.h index a9b854cdfdb5..32094a089a94 100644 --- a/fs/kernfs/kernfs-internal.h +++ b/fs/kernfs/kernfs-internal.h @@ -10,6 +10,7 @@ #ifndef __KERNFS_INTERNAL_H #define __KERNFS_INTERNAL_H
+#include <linux/kabi.h> #include <linux/lockdep.h> #include <linux/fs.h> #include <linux/mutex.h> @@ -49,6 +50,12 @@ struct kernfs_root { struct rw_semaphore kernfs_rwsem; struct rw_semaphore kernfs_iattr_rwsem; struct rw_semaphore kernfs_supers_rwsem; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) + KABI_RESERVE(5) };
/* +1 to avoid triggering overflow warning when negating it */ diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h index 2a36f3218b51..bd3fbcb3c3f6 100644 --- a/include/linux/kernfs.h +++ b/include/linux/kernfs.h @@ -6,6 +6,7 @@ #ifndef __LINUX_KERNFS_H #define __LINUX_KERNFS_H
+#include <linux/kabi.h> #include <linux/err.h> #include <linux/list.h> #include <linux/mutex.h> @@ -242,6 +243,10 @@ struct kernfs_syscall_ops { const char *new_name); int (*show_path)(struct seq_file *sf, struct kernfs_node *kn, struct kernfs_root *root); + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) };
struct kernfs_node *kernfs_root_to_node(struct kernfs_root *root); @@ -316,6 +321,11 @@ struct kernfs_ops { struct poll_table_struct *pt);
int (*mmap)(struct kernfs_open_file *of, struct vm_area_struct *vma); + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) };
/*
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I905SE CVE: NA
--------------------------------
Add kabi slots in xattr_handler struct for future expansion.
struct size(byte) reserve(8*byte) now(byte) xattr_handler 48 2 64
Signed-off-by: Long Li leo.lilong@huawei.com --- include/linux/xattr.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/include/linux/xattr.h b/include/linux/xattr.h index d20051865800..b570d38bf1ec 100644 --- a/include/linux/xattr.h +++ b/include/linux/xattr.h @@ -11,7 +11,7 @@ #ifndef _LINUX_XATTR_H #define _LINUX_XATTR_H
- +#include <linux/kabi.h> #include <linux/slab.h> #include <linux/types.h> #include <linux/spinlock.h> @@ -45,6 +45,9 @@ struct xattr_handler { struct mnt_idmap *idmap, struct dentry *dentry, struct inode *inode, const char *name, const void *buffer, size_t size, int flags); + + KABI_RESERVE(1) + KABI_RESERVE(2) };
/**
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I905SE CVE: NA
--------------------------------
Add kabi slots in nameidata struct for future expansion.
struct size(byte) reserve(8*byte) now(byte) nameidata 232 1 240
Signed-off-by: Long Li leo.lilong@huawei.com --- fs/namei.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/fs/namei.c b/fs/namei.c index 94565bd7e73f..bc796555c832 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -15,6 +15,7 @@ /* [Feb-Apr 2000, AV] Rewrite to the new namespace architecture. */
+#include <linux/kabi.h> #include <linux/init.h> #include <linux/export.h> #include <linux/kernel.h> @@ -587,6 +588,8 @@ struct nameidata { int dfd; vfsuid_t dir_vfsuid; umode_t dir_mode; + + KABI_RESERVE(1) } __randomize_layout;
#define ND_ROOT_PRESET 1
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I905SE CVE: NA
--------------------------------
Add kabi slots in dax_* struct for future expansion.
struct size(byte) reserve(8*byte) now(byte) dax_device 768 8 832 dax_operations 32 4 64 dax_holder_operations 8 3 32
Signed-off-by: Long Li leo.lilong@huawei.com --- drivers/dax/super.c | 10 ++++++++++ include/linux/dax.h | 10 ++++++++++ 2 files changed, 20 insertions(+)
diff --git a/drivers/dax/super.c b/drivers/dax/super.c index 0da9232ea175..34109d40fc50 100644 --- a/drivers/dax/super.c +++ b/drivers/dax/super.c @@ -2,6 +2,7 @@ /* * Copyright(c) 2017 Intel Corporation. All rights reserved. */ +#include <linux/kabi.h> #include <linux/pagemap.h> #include <linux/module.h> #include <linux/mount.h> @@ -33,6 +34,15 @@ struct dax_device { const struct dax_operations *ops; void *holder_data; const struct dax_holder_operations *holder_ops; + + 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 dev_t dax_devt; diff --git a/include/linux/dax.h b/include/linux/dax.h index 22cd9902345d..20e375897733 100644 --- a/include/linux/dax.h +++ b/include/linux/dax.h @@ -2,6 +2,7 @@ #ifndef _LINUX_DAX_H #define _LINUX_DAX_H
+#include <linux/kabi.h> #include <linux/fs.h> #include <linux/mm.h> #include <linux/radix-tree.h> @@ -41,6 +42,11 @@ struct dax_operations { */ size_t (*recovery_write)(struct dax_device *dax_dev, pgoff_t pgoff, void *addr, size_t bytes, struct iov_iter *iter); + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) };
struct dax_holder_operations { @@ -53,6 +59,10 @@ struct dax_holder_operations { */ int (*notify_failure)(struct dax_device *dax_dev, u64 offset, u64 len, int mf_flags); + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) };
#if IS_ENABLED(CONFIG_DAX)
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I905SE CVE: NA
--------------------------------
Add kabi slots in proc_ops struct for future expansion.
struct size(byte) reserve(8*byte) now(byte) proc_ops 96 4 128
Signed-off-by: Long Li leo.lilong@huawei.com --- include/linux/proc_fs.h | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index de407e7c3b55..31b601773465 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h @@ -5,6 +5,7 @@ #ifndef _LINUX_PROC_FS_H #define _LINUX_PROC_FS_H
+#include <linux/kabi.h> #include <linux/compiler.h> #include <linux/types.h> #include <linux/fs.h> @@ -42,6 +43,11 @@ struct proc_ops { #endif int (*proc_mmap)(struct file *, struct vm_area_struct *); unsigned long (*proc_get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) } __randomize_layout;
/* definitions for hide_pid field */
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I905SE CVE: NA
--------------------------------
Add kabi slots in bin_attribute struct for future expansion.
struct size(byte) reserve(8*byte) now(byte) bin_attribute 64 1 72
Signed-off-by: Long Li leo.lilong@huawei.com --- include/linux/sysfs.h | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index fd3fe5c8c17f..20fbe396d471 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h @@ -13,6 +13,7 @@ #ifndef _SYSFS_H_ #define _SYSFS_H_
+#include <linux/kabi.h> #include <linux/kernfs.h> #include <linux/compiler.h> #include <linux/errno.h> @@ -183,6 +184,8 @@ struct bin_attribute { char *, loff_t, size_t); int (*mmap)(struct file *, struct kobject *, struct bin_attribute *attr, struct vm_area_struct *vma); + + KABI_RESERVE(1) };
/**
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/4389 邮件列表地址:https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/4...
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/4389 Mailing list address: https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/4...