diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h index a2eb8be26f453c83d83a7eefc1c3348bd3e2e924..7fc8c62e664fbbc14c9bf59e2155e0f06c3dca5d 100644 --- a/block/blk-cgroup.h +++ b/block/blk-cgroup.h @@ -19,6 +19,7 @@ #include #include #include +#include struct blkcg_gq; struct blkg_policy_data; @@ -49,6 +50,7 @@ struct blkg_iostat_set { int lqueued; /* queued in llist */ struct blkg_iostat cur; struct blkg_iostat last; + KABI_RESERVE(1) }; /* association between a blk cgroup and a request queue */ @@ -116,7 +118,12 @@ struct blkcg { #endif #ifdef CONFIG_CGROUP_V1_WRITEBACK struct list_head memcg_list; +#else + KABI_RESERVE(1) + KABI_RESERVE(2) #endif + KABI_RESERVE(3) + KABI_RESERVE(4) }; static inline struct blkcg *css_to_blkcg(struct cgroup_subsys_state *css) @@ -186,6 +193,10 @@ struct blkcg_policy { blkcg_pol_free_pd_fn *pd_free_fn; blkcg_pol_reset_pd_stats_fn *pd_reset_stats_fn; blkcg_pol_stat_pd_fn *pd_stat_fn; + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) }; extern struct blkcg blkcg_root; diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h index 2921ddb732aca41fc2f3d2d3fe5055daf2280999..b464733c2b20d73934c3c69f59e140abe07878e9 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,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; /* diff --git a/include/linux/cgroup_rdma.h b/include/linux/cgroup_rdma.h index 80edae03c3138e0737ab63d5529dd0688caadb95..bc4ac2d29d158f4435fe2c19c9ae0be2c4c8c3a5 100644 --- a/include/linux/cgroup_rdma.h +++ b/include/linux/cgroup_rdma.h @@ -7,6 +7,7 @@ #define _CGROUP_RDMA_H #include +#include enum rdmacg_resource_type { RDMACG_RESOURCE_HCA_HANDLE, @@ -24,6 +25,8 @@ struct rdma_cgroup { * that belongs to this cgroup. */ struct list_head rpools; + + KABI_RESERVE(1) }; struct rdmacg_device { diff --git a/include/linux/misc_cgroup.h b/include/linux/misc_cgroup.h index e799b1f8d05bb37745af7cc3e31f2b0f8a5f441c..0699d7d7d3e7cfd25a36fab0f1e74126d5f40796 100644 --- a/include/linux/misc_cgroup.h +++ b/include/linux/misc_cgroup.h @@ -8,6 +8,8 @@ #ifndef _MISC_CGROUP_H_ #define _MISC_CGROUP_H_ +#include + /** * Types of misc cgroup entries supported by the host. */ @@ -18,6 +20,11 @@ enum misc_res_type { /* AMD SEV-ES ASIDs resource */ MISC_CG_RES_SEV_ES, #endif + MISC_KABI_RESERVE1, + MISC_KABI_RESERVE2, + MISC_KABI_RESERVE3, + MISC_KABI_RESERVE4, + MISC_KABI_RESERVE5, MISC_CG_RES_TYPES }; @@ -37,6 +44,8 @@ struct misc_res { u64 max; atomic64_t usage; atomic64_t events; + KABI_RESERVE(1) + KABI_RESERVE(2) }; /** @@ -52,6 +61,8 @@ struct misc_cg { struct cgroup_file events_file; struct misc_res res[MISC_CG_RES_TYPES]; + KABI_RESERVE(1) + KABI_RESERVE(2) }; 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..1d924fbf91530efc4fd73dda2f373705e09023d8 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,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 f9f9931e02d6ad51970be627edcc58fbda879f0f..b784e073d168c9466c86698631f79bffea96d89f 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 @@ -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 45f09bec02c485dbcf9f9607725a7f839dda01d3..191727a1a22c78f5dd70aa52d923df8499917c41 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 @@ -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 4aa6166cb8563c5ba47a04a391c797d058ff0a16..82238cd28aedd6017ead2db8c688986702bcffb3 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 { } };