From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753818AbdJPPej (ORCPT ); Mon, 16 Oct 2017 11:34:39 -0400 Received: from mx1.mailbox.org ([80.241.60.212]:60332 "EHLO mx1.mailbox.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753427AbdJPPei (ORCPT ); Mon, 16 Oct 2017 11:34:38 -0400 From: Christian Brauner To: linux-kernel@vger.kernel.org Cc: stgraber@ubuntu.com, tycho@tycho.ws, Christian Brauner Subject: [PATCH 1/2 v3] user namespace: use union in {g,u}idmap struct Date: Mon, 16 Oct 2017 17:34:27 +0200 Message-Id: <20171016153428.25973-1-christian.brauner@ubuntu.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is preparation for bumping the {g,u}idmap limits for usernamespaces. Signed-off-by: Christian Brauner --- 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