diff --git a/include/linux/cred.h b/include/linux/cred.h index 18639c069263fbe79dfd5a36163c656dca5da220..280e86c4d7686c136db61b0dd78d6ae9dd6b90e9 100644 --- a/include/linux/cred.h +++ b/include/linux/cred.h @@ -15,6 +15,7 @@ #include #include #include +#include struct cred; struct inode; @@ -150,6 +151,7 @@ struct cred { int non_rcu; /* Can we skip RCU deletion? */ struct rcu_head rcu; /* RCU deletion hook */ }; + KABI_RESERVE(1) /* reserved for ucounts */ } __randomize_layout; extern void __put_cred(struct cred *); diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h index ea2f4dc954458832d97a1ad518407d3791916bda..d7d02654a49ea0241f4f153b9030a8711fab5a6b 100644 --- a/include/linux/user_namespace.h +++ b/include/linux/user_namespace.h @@ -50,6 +50,26 @@ enum ucount_type { UCOUNT_INOTIFY_INSTANCES, UCOUNT_INOTIFY_WATCHES, #endif + /* 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, UCOUNT_COUNTS, }; diff --git a/kernel/ucount.c b/kernel/ucount.c index 04c561751af1e8a92f6a62e331c3f6b68fd1f0d1..dff1d9b739d2645015e06417f4f425e786d04e2d 100644 --- a/kernel/ucount.c +++ b/kernel/ucount.c @@ -74,6 +74,22 @@ static struct ctl_table user_table[] = { UCOUNT_ENTRY("max_inotify_instances"), UCOUNT_ENTRY("max_inotify_watches"), #endif + /* 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 /* CONFIG_SYSCTL */