Commit 5d12a17b authored by GONG, Ruiqi's avatar GONG, Ruiqi Committed by GONG Ruiqi
Browse files

kabi: use CONFIG_KABI_RESERVE to control reservation in ucount_type and user_table

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I4MYYH


CVE: NA

----------------------------------------

Commit 328e6481 ("kabi: reserve space for cred and user_namespace"),
besides reserving space for struct cred and struct user_namespace, adds
new members to enum ucount_type and struct ctl_table user_table[] as
well. Use CONFIG_KABI_RESERVE to control them.

Signed-off-by: default avatarGONG, Ruiqi <gongruiqi1@huawei.com>
parent 41255614
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ enum ucount_type {
	UCOUNT_INOTIFY_INSTANCES,
	UCOUNT_INOTIFY_WATCHES,
#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
@@ -71,6 +72,7 @@ enum ucount_type {
	UCOUNT_KABI_RESERVE13,
	UCOUNT_KABI_RESERVE14,
	UCOUNT_KABI_RESERVE15,
#endif
	UCOUNT_COUNTS,
};

+2 −0
Original line number Diff line number Diff line
@@ -77,6 +77,7 @@ static struct ctl_table user_table[] = {
	UCOUNT_ENTRY("max_inotify_instances"),
	UCOUNT_ENTRY("max_inotify_watches"),
#endif
#ifdef CONFIG_KABI_RESERVE
	/* These corresponds to the reservation in enum ucount_type */
	{ }, // UCOUNT_KABI_RESERVE1
	{ }, // UCOUNT_KABI_RESERVE2
@@ -93,6 +94,7 @@ static struct ctl_table user_table[] = {
	{ }, // UCOUNT_KABI_RESERVE13
	{ }, // UCOUNT_KABI_RESERVE14
	{ }, // UCOUNT_KABI_RESERVE15
#endif
	{ }
};
#endif /* CONFIG_SYSCTL */