
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 | 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) }; /* -- 2.31.1