public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2 v3] user namespace: use union in {g,u}idmap struct
@ 2017-10-16 15:34 Christian Brauner
  2017-10-16 15:34 ` [PATCH 2/2 v3] user namespaces: bump idmap limits to 340 Christian Brauner
  2017-10-18 22:51 ` [PATCH 1/2 v3] user namespace: use union in {g,u}idmap struct kbuild test robot
  0 siblings, 2 replies; 7+ messages in thread
From: Christian Brauner @ 2017-10-16 15:34 UTC (permalink / raw)
  To: linux-kernel; +Cc: stgraber, tycho, Christian Brauner

This is preparation for bumping the {g,u}idmap limits for usernamespaces.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
---
Changelog 2017-10-16:
* Trivial: fix email addresses in CC: lines
---
 include/linux/user_namespace.h | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h
index c18e01252346..7c83d7f6289b 100644
--- a/include/linux/user_namespace.h
+++ b/include/linux/user_namespace.h
@@ -12,13 +12,21 @@
 
 #define UID_GID_MAP_MAX_EXTENTS 5
 
+struct uid_gid_extent {
+	u32 first;
+	u32 lower_first;
+	u32 count;
+};
+
 struct uid_gid_map {	/* 64 bytes -- 1 cache line */
 	u32 nr_extents;
-	struct uid_gid_extent {
-		u32 first;
-		u32 lower_first;
-		u32 count;
-	} extent[UID_GID_MAP_MAX_EXTENTS];
+	union {
+		struct uid_gid_extent extent[UID_GID_MAP_MAX_EXTENTS];
+		struct {
+			struct uid_gid_extent *forward;
+			struct uid_gid_extent *reverse;
+		};
+	};
 };
 
 #define USERNS_SETGROUPS_ALLOWED 1UL
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-10-19 16:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-16 15:34 [PATCH 1/2 v3] user namespace: use union in {g,u}idmap struct Christian Brauner
2017-10-16 15:34 ` [PATCH 2/2 v3] user namespaces: bump idmap limits to 340 Christian Brauner
2017-10-18 22:51 ` [PATCH 1/2 v3] user namespace: use union in {g,u}idmap struct kbuild test robot
2017-10-18 23:42   ` Christian Brauner
2017-10-19  0:48     ` Eric W. Biederman
2017-10-19 16:15       ` Christian Brauner
2017-10-19 16:38         ` Eric W. Biederman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox