diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h index 2921ddb732aca41fc2f3d2d3fe5055daf2280999..81c1c2c7366fef6f2398c38cbc9c27cd66ab4b77 100644 --- a/include/linux/cgroup-defs.h +++ b/include/linux/cgroup-defs.h @@ -21,6 +21,7 @@ #include #include #include +#include #ifdef CONFIG_CGROUPS @@ -143,6 +144,10 @@ struct cgroup_file { struct kernfs_node *kn; unsigned long notified_at; struct timer_list notify_timer; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) }; /* @@ -200,6 +205,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 +307,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 +383,11 @@ 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) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) }; struct cgroup_freezer_state { @@ -525,6 +545,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 +595,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 +689,9 @@ struct cftype { __poll_t (*poll)(struct kernfs_open_file *of, struct poll_table_struct *pt); + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) #ifdef CONFIG_DEBUG_LOCK_ALLOC struct lock_class_key lockdep_key; #endif @@ -693,6 +726,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; /* diff --git a/include/linux/misc_cgroup.h b/include/linux/misc_cgroup.h index e799b1f8d05bb37745af7cc3e31f2b0f8a5f441c..c7ef6e744f4d76c324afd4c84c37d99d6f50a565 100644 --- a/include/linux/misc_cgroup.h +++ b/include/linux/misc_cgroup.h @@ -7,6 +7,7 @@ */ #ifndef _MISC_CGROUP_H_ #define _MISC_CGROUP_H_ +#include /** * Types of misc cgroup entries supported by the host. @@ -18,6 +19,11 @@ enum misc_res_type { /* AMD SEV-ES ASIDs resource */ MISC_CG_RES_SEV_ES, #endif + MISC_RES_TYPE_RESERVE1, + MISC_RES_TYPE_RESERVE2, + MISC_RES_TYPE_RESERVE3, + MISC_RES_TYPE_RESERVE4, + MISC_RES_TYPE_RESERVE5, MISC_CG_RES_TYPES }; @@ -37,6 +43,9 @@ struct misc_res { u64 max; atomic64_t usage; atomic64_t events; + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) }; /** @@ -52,6 +61,9 @@ struct misc_cg { struct cgroup_file events_file; struct misc_res res[MISC_CG_RES_TYPES]; + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) }; u64 misc_cg_res_total_usage(enum misc_res_type type); diff --git a/include/linux/nsproxy.h b/include/linux/nsproxy.h index 771cb028587242a55509e4aa99684f61b0598f03..b5839c1b7667ac7fe4f4c2726d01b06cef9bf3d3 100644 --- a/include/linux/nsproxy.h +++ b/include/linux/nsproxy.h @@ -4,6 +4,7 @@ #include #include +#include struct mnt_namespace; struct uts_namespace; @@ -38,6 +39,9 @@ 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) }; extern struct nsproxy init_nsproxy; diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h index 0a7c6dab0b7bea979bc300bccde43c79400d242e..7ab8c213f13b101b498b634a5549314ef71dfed3 100644 --- a/include/linux/pid_namespace.h +++ b/include/linux/pid_namespace.h @@ -10,6 +10,7 @@ #include #include #include +#include /* MAX_PID_NS_LEVEL is needed for limiting size of 'struct pid' */ #define MAX_PID_NS_LEVEL 32 @@ -44,6 +45,9 @@ struct pid_namespace { #if defined(CONFIG_SYSCTL) && defined(CONFIG_MEMFD_CREATE) int memfd_noexec_scope; #endif + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) } __randomize_layout; extern struct pid_namespace init_pid_ns; diff --git a/include/linux/psi_types.h b/include/linux/psi_types.h index 3a72e6def0f761b74254ac4e766b88e2a2dc0d34..1c5bca4e48ed0d50f0895863a0494f63992bf43e 100644 --- a/include/linux/psi_types.h +++ b/include/linux/psi_types.h @@ -7,6 +7,7 @@ #include #include #include +#include #ifdef CONFIG_PSI @@ -99,6 +100,12 @@ enum psi_stat_states { #ifdef CONFIG_QOS_SCHED PSI_CPU_QOS_FULL, #endif + PSI_STATE_RESERVE1, + PSI_STATE_RESERVE2, + PSI_STATE_RESERVE3, + PSI_STATE_RESERVE4, + PSI_STATE_RESERVE5, + PSI_STATE_RESERVE6, NR_PSI_STAT_STATES, }; @@ -113,6 +120,12 @@ enum psi_stat_task_count { NR_ASYNC_MEMCG_RECLAIM_RUNNING, NR_SWAP, NR_SWAP_RUNNING, + NR_PSI_ST_RESERVE1, + NR_PSI_ST_RESERVE2, + NR_PSI_ST_RESERVE3, + NR_PSI_ST_RESERVE4, + NR_PSI_ST_RESERVE5, + NR_PSI_ST_RESERVE6, NR_PSI_STAT_TASK_COUNTS, }; #endif /* CONFIG_PSI_FINE_GRAINED */ @@ -151,6 +164,11 @@ struct psi_group_cpu { int prev_throttle; int cur_throttle; #endif + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) + KABI_RESERVE(5) }; /* PSI growth tracking window */ @@ -166,6 +184,9 @@ struct psi_window { /* Value growth in the previous window */ u64 prev_growth; + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) }; struct psi_trigger { @@ -204,6 +225,9 @@ struct psi_trigger { /* Trigger type - PSI_AVGS for unprivileged, PSI_POLL for RT */ enum psi_aggregators aggregator; + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) }; struct psi_group { @@ -259,6 +283,10 @@ struct psi_group { u64 fine_grained_total[NR_PSI_AGGREGATORS][NR_PSI_STAT_STATES]; unsigned long fine_grained_avg[NR_PSI_STAT_STATES][3]; #endif + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) }; #else /* CONFIG_PSI */ diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h index 45f09bec02c485dbcf9f9607725a7f839dda01d3..fe1255b14a076229e046cee42adc364a878a4e54 100644 --- a/include/linux/user_namespace.h +++ b/include/linux/user_namespace.h @@ -10,6 +10,7 @@ #include #include #include +#include #define UID_GID_MAP_MAX_BASE_EXTENTS 5 #define UID_GID_MAP_MAX_EXTENTS 340 @@ -54,6 +55,9 @@ enum ucount_type { UCOUNT_FANOTIFY_GROUPS, UCOUNT_FANOTIFY_MARKS, #endif + UCOUNT_KABI_RESERVE1, + UCOUNT_KABI_RESERVE2, + UCOUNT_KABI_RESERVE3, UCOUNT_COUNTS, }; @@ -102,6 +106,9 @@ 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) } __randomize_layout; struct ucounts { diff --git a/kernel/ucount.c b/kernel/ucount.c index 4aa6166cb8563c5ba47a04a391c797d058ff0a16..b806645ab89c1d526566077988c9c6278038b436 100644 --- a/kernel/ucount.c +++ b/kernel/ucount.c @@ -87,6 +87,10 @@ static struct ctl_table user_table[] = { UCOUNT_ENTRY("max_fanotify_groups"), UCOUNT_ENTRY("max_fanotify_marks"), #endif + /* These corresponds to the reservation in enum ucount_type */ + { }, // UCOUNT_KABI_RESERVE1 + { }, // UCOUNT_KABI_RESERVE2 + { }, // UCOUNT_KABI_RESERVE3 { } }; #endif /* CONFIG_SYSCTL */