diff options
author | Christian Brauner <christian.brauner@ubuntu.com> | 2017-10-25 00:04:40 +0200 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2017-10-31 17:22:58 -0500 |
commit | aa4bf44dc851c6bdd4f7b61b5f2c56c84dfe2ff0 (patch) | |
tree | ca3bdc2e66ad9585112fa7a08fd8ce9304f509b8 /include/linux/user_namespace.h | |
parent | e19b205be43d11bff638cad4487008c48d21c103 (diff) | |
download | blackbird-op-linux-aa4bf44dc851c6bdd4f7b61b5f2c56c84dfe2ff0.tar.gz blackbird-op-linux-aa4bf44dc851c6bdd4f7b61b5f2c56c84dfe2ff0.zip |
userns: use union in {g,u}idmap struct
- Add a struct containing two pointer to extents and wrap both the static extent
array and the struct into a union. This is done in preparation for bumping the
{g,u}idmap limits for user namespaces.
- Add brackets around anonymous union when using designated initializers to
initialize members in order to please gcc <= 4.4.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'include/linux/user_namespace.h')
-rw-r--r-- | include/linux/user_namespace.h | 18 |
1 files 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 |