
From: Lu Jialin <lujialin4@huawei.com> hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4GII8?from=project-issue CVE: NA -------- We reserve some fields beforehand for cgroup framework related structures prone to change, therefore, we can hot add/change features of cgroupv1/cgroupv2 with this enhancement. After reserving, normally cache does not matter as the reserved fields are not accessed at all. --------- Signed-off-by: Lu Jialin <lujialin4@huawei.com> Reviewed-by: weiyang wang <wangweiyang2@huawei.com> Reviewed-by: Xiu Jianfeng <xiujianfeng@huawei.com> Signed-off-by: Zheng Zengkai <zhengzengkai@huawei.com> --- include/linux/cgroup-defs.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h index b87e13609f0f..648c2e1ec442 100644 --- a/include/linux/cgroup-defs.h +++ b/include/linux/cgroup-defs.h @@ -21,6 +21,7 @@ #include <linux/workqueue.h> #include <linux/bpf-cgroup.h> #include <linux/psi_types.h> +#include <linux/kabi.h> #ifdef CONFIG_CGROUPS @@ -126,6 +127,9 @@ struct cgroup_file { struct kernfs_node *kn; unsigned long notified_at; struct timer_list notify_timer; + + KABI_RESERVE(1) + KABI_RESERVE(2) }; /* @@ -183,6 +187,11 @@ struct cgroup_subsys_state { * fields of the containing structure. */ struct cgroup_subsys_state *parent; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) }; /* @@ -279,6 +288,11 @@ struct css_set { /* For RCU-protected deletion */ struct rcu_head rcu_head; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) }; struct cgroup_base_stat { @@ -482,6 +496,10 @@ struct cgroup { /* Used to store internal freezer state */ struct cgroup_freezer_state freezer; + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + /* ids of the ancestors at each level including self */ u64 ancestor_ids[]; }; @@ -523,6 +541,11 @@ struct cgroup_root { /* The name for this hierarchy - may be empty */ char name[MAX_CGROUP_ROOT_NAMELEN]; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) }; /* @@ -618,6 +641,8 @@ struct cftype { __poll_t (*poll)(struct kernfs_open_file *of, struct poll_table_struct *pt); + KABI_RESERVE(1) + #ifdef CONFIG_DEBUG_LOCK_ALLOC struct lock_class_key lockdep_key; #endif @@ -650,6 +675,10 @@ struct cgroup_subsys { void (*release)(struct task_struct *task); void (*bind)(struct cgroup_subsys_state *root_css); + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) bool early_init:1; /* -- 2.20.1