Chen Ridong (3): cgroup: kabi: reserve space for cgroup frame namespace: kabi: reserve for future namespace development cgroup/psi: reserve kabi for future psi development
include/linux/cgroup-defs.h | 32 ++++++++++++++++++++++++++++++++ include/linux/ipc_namespace.h | 6 ++++++ include/linux/nsproxy.h | 9 +++++++++ include/linux/pid_namespace.h | 2 ++ include/linux/psi_types.h | 16 ++++++++++++++++ include/linux/user_namespace.h | 33 +++++++++++++++++++++++++++++++++ kernel/ucount.c | 18 ++++++++++++++++++ 7 files changed, 116 insertions(+)
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I8SA3O CVE: N/A
-----------------------
kabi: reserve space for cgroup frame
Signed-off-by: Chen Ridong chenridong@huawei.com --- include/linux/cgroup-defs.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+)
diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h index 2921ddb732ac..b464733c2b20 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-defs.h> #include <linux/psi_types.h> +#include <linux/kabi.h>
#ifdef CONFIG_CGROUPS
@@ -143,6 +144,9 @@ struct cgroup_file { struct kernfs_node *kn; unsigned long notified_at; struct timer_list notify_timer; + + KABI_RESERVE(1) + KABI_RESERVE(2) };
/* @@ -200,6 +204,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) };
/* @@ -297,6 +306,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 { @@ -368,6 +382,8 @@ struct cgroup_rstat_cpu { */ struct cgroup *updated_children; /* terminated by self cgroup */ struct cgroup *updated_next; /* NULL iff not on the list */ + + KABI_RESERVE(1) };
struct cgroup_freezer_state { @@ -525,6 +541,11 @@ struct cgroup { struct bpf_local_storage __rcu *bpf_cgrp_storage; #endif
+ KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) + KABI_RESERVE(5) /* All ancestors including self */ struct cgroup *ancestors[]; }; @@ -570,6 +591,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) };
/* @@ -659,6 +685,7 @@ 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 @@ -693,6 +720,11 @@ 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;
/*
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I8SA3O
----------------------------------------------------------------------
Reserve KABI for future namespace development.
Signed-off-by: Chen Ridong chenridong@huawei.com --- include/linux/ipc_namespace.h | 6 ++++++ include/linux/nsproxy.h | 9 +++++++++ include/linux/pid_namespace.h | 2 ++ include/linux/user_namespace.h | 33 +++++++++++++++++++++++++++++++++ kernel/ucount.c | 18 ++++++++++++++++++ 5 files changed, 68 insertions(+)
diff --git a/include/linux/ipc_namespace.h b/include/linux/ipc_namespace.h index e8240cf2611a..ec853262a194 100644 --- a/include/linux/ipc_namespace.h +++ b/include/linux/ipc_namespace.h @@ -12,6 +12,7 @@ #include <linux/rhashtable-types.h> #include <linux/sysctl.h> #include <linux/percpu_counter.h> +#include <linux/kabi.h>
struct user_namespace;
@@ -78,6 +79,11 @@ struct ipc_namespace { struct llist_node mnt_llist;
struct ns_common ns; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) } __randomize_layout;
extern struct ipc_namespace init_ipc_ns; diff --git a/include/linux/nsproxy.h b/include/linux/nsproxy.h index 771cb0285872..1d924fbf9153 100644 --- a/include/linux/nsproxy.h +++ b/include/linux/nsproxy.h @@ -4,6 +4,7 @@
#include <linux/spinlock.h> #include <linux/sched.h> +#include <linux/kabi.h>
struct mnt_namespace; struct uts_namespace; @@ -38,6 +39,14 @@ struct nsproxy { struct time_namespace *time_ns; struct time_namespace *time_ns_for_children; struct cgroup_namespace *cgroup_ns; + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) + KABI_RESERVE(5) + KABI_RESERVE(6) + KABI_RESERVE(7) + KABI_RESERVE(8) }; extern struct nsproxy init_nsproxy;
diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h index f9f9931e02d6..b784e073d168 100644 --- a/include/linux/pid_namespace.h +++ b/include/linux/pid_namespace.h @@ -10,6 +10,7 @@ #include <linux/nsproxy.h> #include <linux/ns_common.h> #include <linux/idr.h> +#include <linux/kabi.h>
/* MAX_PID_NS_LEVEL is needed for limiting size of 'struct pid' */ #define MAX_PID_NS_LEVEL 32 @@ -41,6 +42,7 @@ struct pid_namespace { #if defined(CONFIG_SYSCTL) && defined(CONFIG_MEMFD_CREATE) int memfd_noexec_scope; #endif + KABI_RESERVE(1) } __randomize_layout;
extern struct pid_namespace init_pid_ns; diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h index 45f09bec02c4..191727a1a22c 100644 --- a/include/linux/user_namespace.h +++ b/include/linux/user_namespace.h @@ -10,6 +10,7 @@ #include <linux/rwsem.h> #include <linux/sysctl.h> #include <linux/err.h> +#include <linux/kabi.h>
#define UID_GID_MAP_MAX_BASE_EXTENTS 5 #define UID_GID_MAP_MAX_EXTENTS 340 @@ -53,6 +54,28 @@ enum ucount_type { #ifdef CONFIG_FANOTIFY UCOUNT_FANOTIFY_GROUPS, UCOUNT_FANOTIFY_MARKS, +#endif +#ifdef CONFIG_KABI_RESERVE + /* These 15 members are reserved (with extra margin) for the future + * enlargement of enum ucount_type, as how RH8.1 did it. This number + * should be enough, as 6 of them are very likely to be used in the near + * future. + */ + UCOUNT_KABI_RESERVE1, + UCOUNT_KABI_RESERVE2, + UCOUNT_KABI_RESERVE3, + UCOUNT_KABI_RESERVE4, + UCOUNT_KABI_RESERVE5, + UCOUNT_KABI_RESERVE6, + UCOUNT_KABI_RESERVE7, + UCOUNT_KABI_RESERVE8, + UCOUNT_KABI_RESERVE9, + UCOUNT_KABI_RESERVE10, + UCOUNT_KABI_RESERVE11, + UCOUNT_KABI_RESERVE12, + UCOUNT_KABI_RESERVE13, + UCOUNT_KABI_RESERVE14, + UCOUNT_KABI_RESERVE15, #endif UCOUNT_COUNTS, }; @@ -102,6 +125,16 @@ struct user_namespace { struct ucounts *ucounts; long ucount_max[UCOUNT_COUNTS]; long rlimit_max[UCOUNT_RLIMIT_COUNTS]; + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) + KABI_RESERVE(5) + KABI_RESERVE(6) + KABI_RESERVE(7) + KABI_RESERVE(8) + KABI_RESERVE(9) + KABI_RESERVE(10) } __randomize_layout;
struct ucounts { diff --git a/kernel/ucount.c b/kernel/ucount.c index 4aa6166cb856..82238cd28aed 100644 --- a/kernel/ucount.c +++ b/kernel/ucount.c @@ -86,6 +86,24 @@ static struct ctl_table user_table[] = { #ifdef CONFIG_FANOTIFY UCOUNT_ENTRY("max_fanotify_groups"), UCOUNT_ENTRY("max_fanotify_marks"), +#endif +#ifdef CONFIG_KABI_RESERVE + /* These corresponds to the reservation in enum ucount_type */ + { }, // UCOUNT_KABI_RESERVE1 + { }, // UCOUNT_KABI_RESERVE2 + { }, // UCOUNT_KABI_RESERVE3 + { }, // UCOUNT_KABI_RESERVE4 + { }, // UCOUNT_KABI_RESERVE5 + { }, // UCOUNT_KABI_RESERVE6 + { }, // UCOUNT_KABI_RESERVE7 + { }, // UCOUNT_KABI_RESERVE8 + { }, // UCOUNT_KABI_RESERVE9 + { }, // UCOUNT_KABI_RESERVE10 + { }, // UCOUNT_KABI_RESERVE11 + { }, // UCOUNT_KABI_RESERVE12 + { }, // UCOUNT_KABI_RESERVE13 + { }, // UCOUNT_KABI_RESERVE14 + { }, // UCOUNT_KABI_RESERVE15 #endif { } };
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I8SA3O
----------------------------------------------------------------------
cgroup/psi: reserve kabi for future psi development Signed-off-by: Chen Ridong chenridong@huawei.com --- include/linux/psi_types.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
diff --git a/include/linux/psi_types.h b/include/linux/psi_types.h index f1fd3a8044e0..de67d8948f45 100644 --- a/include/linux/psi_types.h +++ b/include/linux/psi_types.h @@ -7,6 +7,7 @@ #include <linux/types.h> #include <linux/kref.h> #include <linux/wait.h> +#include <linux/kabi.h>
#ifdef CONFIG_PSI
@@ -104,6 +105,12 @@ struct psi_group_cpu { /* Delta detection against the sampling buckets */ u32 times_prev[NR_PSI_AGGREGATORS][NR_PSI_STATES] ____cacheline_aligned_in_smp; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) + KABI_RESERVE(5) };
/* PSI growth tracking window */ @@ -119,6 +126,9 @@ struct psi_window {
/* Value growth in the previous window */ u64 prev_growth; + + KABI_RESERVE(1) + KABI_RESERVE(2) };
struct psi_trigger { @@ -157,6 +167,9 @@ struct psi_trigger {
/* Trigger type - PSI_AVGS for unprivileged, PSI_POLL for RT */ enum psi_aggregators aggregator; + + KABI_RESERVE(1) + KABI_RESERVE(2) };
struct psi_group { @@ -205,6 +218,9 @@ struct psi_group { u64 rtpoll_total[NR_PSI_STATES - 1]; u64 rtpoll_next_update; u64 rtpoll_until; + + KABI_RESERVE(1) + KABI_RESERVE(2) };
#else /* CONFIG_PSI */
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/3817 邮件列表地址:https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/J...
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/3817 Mailing list address: https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/J...