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 | 9 +++++++++ fs/kernfs/file.c | 4 ++++ fs/kernfs/kernfs-internal.h | 6 ++++++ fs/namei.c | 2 ++ include/linux/dax.h | 9 +++++++++ include/linux/fscrypt.h | 4 ++++ include/linux/fsnotify_backend.h | 14 ++++++++++++++ include/linux/kernfs.h | 10 ++++++++++ include/linux/proc_fs.h | 5 +++++ include/linux/sysfs.h | 2 ++ include/linux/xattr.h | 5 ++++- 11 files changed, 69 insertions(+), 1 deletion(-)
hulk inclusion category: feature 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 | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/include/linux/fscrypt.h b/include/linux/fscrypt.h index c895b12737a1..1ede2ebb0096 100644 --- a/include/linux/fscrypt.h +++ b/include/linux/fscrypt.h @@ -176,6 +176,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: feature 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 | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h index c0892d75ce33..6004df55fc7b 100644 --- a/include/linux/fsnotify_backend.h +++ b/include/linux/fsnotify_backend.h @@ -165,6 +165,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 +177,8 @@ struct fsnotify_ops { */ struct fsnotify_event { struct list_head list; + KABI_RESERVE(1) + KABI_RESERVE(2) };
/* @@ -255,6 +260,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: feature 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 | 4 ++++ fs/kernfs/kernfs-internal.h | 6 ++++++ include/linux/kernfs.h | 10 ++++++++++ 3 files changed, 20 insertions(+)
diff --git a/fs/kernfs/file.c b/fs/kernfs/file.c index 180906c36f51..1cbf9a44422e 100644 --- a/fs/kernfs/file.c +++ b/fs/kernfs/file.c @@ -25,6 +25,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..ade12719da29 100644 --- a/fs/kernfs/kernfs-internal.h +++ b/fs/kernfs/kernfs-internal.h @@ -49,6 +49,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: feature 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: feature 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 | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/fs/namei.c b/fs/namei.c index 94565bd7e73f..7b7fcb156669 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -587,6 +587,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: feature 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 | 9 +++++++++ include/linux/dax.h | 9 +++++++++ 2 files changed, 18 insertions(+)
diff --git a/drivers/dax/super.c b/drivers/dax/super.c index 0da9232ea175..cded535b3610 100644 --- a/drivers/dax/super.c +++ b/drivers/dax/super.c @@ -33,6 +33,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..00bbfcb7c567 100644 --- a/include/linux/dax.h +++ b/include/linux/dax.h @@ -41,6 +41,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 +58,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: feature 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 | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index de407e7c3b55..c742bedf2a8c 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h @@ -42,6 +42,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: feature 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 | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index fd3fe5c8c17f..1fbd741a2962 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h @@ -183,6 +183,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/4554 邮件列表地址:https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/N...
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/4554 Mailing list address: https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/N...