From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751490AbdJRXmc (ORCPT ); Wed, 18 Oct 2017 19:42:32 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:49252 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750946AbdJRXma (ORCPT ); Wed, 18 Oct 2017 19:42:30 -0400 X-Google-Smtp-Source: ABhQp+QVXHeUaRuA4MaEa7FQiUzMXGukXrQAeLCIdtg+N4sUsGzve2soNJnUXpIwyZp9f3pwbVpI2Q== Date: Thu, 19 Oct 2017 01:42:27 +0200 From: Christian Brauner To: kbuild test robot Cc: Christian Brauner , kbuild-all@01.org, linux-kernel@vger.kernel.org, stgraber@ubuntu.com, tycho@tycho.ws, ebiederm@xmission.com, serge@hallyn.com Subject: Re: [PATCH 1/2 v3] user namespace: use union in {g,u}idmap struct Message-ID: <20171018234226.wgfpp3cybuaxzvgu@gmail.com> References: <20171016153428.25973-1-christian.brauner@ubuntu.com> <201710190651.ZPvHydXh%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201710190651.ZPvHydXh%fengguang.wu@intel.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I'm not sure why the build is complaining about how the union is initialized here. This looks legitimate to me and I can't reproduce this locally with or without the appended config. The struct introduced here is: #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; union { struct uid_gid_extent extent[UID_GID_MAP_MAX_EXTENTS]; struct { struct uid_gid_extent *forward; struct uid_gid_extent *reverse; }; }; }; And the initialization in kernel/user.c which I didn't change looks correct. But maybe I'm missing the point. Christian On Thu, Oct 19, 2017 at 06:51:48AM +0800, kbuild test robot wrote: > Hi Christian, > > [auto build test ERROR on linus/master] > [also build test ERROR on v4.14-rc5 next-20171017] > [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] > > url: https://github.com/0day-ci/linux/commits/Christian-Brauner/user-namespace-use-union-in-g-u-idmap-struct/20171019-022142 > config: x86_64-randconfig-a0-10190527 (attached as .config) > compiler: gcc-4.4 (Debian 4.4.7-8) 4.4.7 > reproduce: > # save the attached .config to linux build tree > make ARCH=x86_64 > > All error/warnings (new ones prefixed by >>): > > >> kernel/user.c:29: error: unknown field 'extent' specified in initializer > >> kernel/user.c:30: error: unknown field 'first' specified in initializer > >> kernel/user.c:30: warning: missing braces around initializer > kernel/user.c:30: warning: (near initialization for 'init_user_ns.uid_map..extent') > >> kernel/user.c:31: error: unknown field 'lower_first' specified in initializer > >> kernel/user.c:31: warning: excess elements in union initializer > kernel/user.c:31: warning: (near initialization for 'init_user_ns.uid_map.') > >> kernel/user.c:32: error: unknown field 'count' specified in initializer > kernel/user.c:32: warning: excess elements in union initializer > kernel/user.c:32: warning: (near initialization for 'init_user_ns.uid_map.') > kernel/user.c:37: error: unknown field 'extent' specified in initializer > kernel/user.c:38: error: unknown field 'first' specified in initializer > kernel/user.c:39: error: unknown field 'lower_first' specified in initializer > kernel/user.c:39: warning: excess elements in union initializer > kernel/user.c:39: warning: (near initialization for 'init_user_ns.gid_map.') > kernel/user.c:40: error: unknown field 'count' specified in initializer > kernel/user.c:40: warning: excess elements in union initializer > kernel/user.c:40: warning: (near initialization for 'init_user_ns.gid_map.') > kernel/user.c:45: error: unknown field 'extent' specified in initializer > kernel/user.c:46: error: unknown field 'first' specified in initializer > kernel/user.c:47: error: unknown field 'lower_first' specified in initializer > kernel/user.c:47: warning: excess elements in union initializer > kernel/user.c:47: warning: (near initialization for 'init_user_ns.projid_map.') > kernel/user.c:48: error: unknown field 'count' specified in initializer > kernel/user.c:48: warning: excess elements in union initializer > kernel/user.c:48: warning: (near initialization for 'init_user_ns.projid_map.') > > vim +/lower_first +31 kernel/user.c > > ^1da177e4 Linus Torvalds 2005-04-16 21 > 59607db36 Serge E. Hallyn 2011-03-23 22 /* > 59607db36 Serge E. Hallyn 2011-03-23 23 * userns count is 1 for root user, 1 for init_uts_ns, > 59607db36 Serge E. Hallyn 2011-03-23 24 * and 1 for... ? > 59607db36 Serge E. Hallyn 2011-03-23 25 */ > aee16ce73 Pavel Emelyanov 2008-02-08 26 struct user_namespace init_user_ns = { > 22d917d80 Eric W. Biederman 2011-11-17 27 .uid_map = { > 22d917d80 Eric W. Biederman 2011-11-17 28 .nr_extents = 1, > 22d917d80 Eric W. Biederman 2011-11-17 @29 .extent[0] = { > 22d917d80 Eric W. Biederman 2011-11-17 @30 .first = 0, > 22d917d80 Eric W. Biederman 2011-11-17 @31 .lower_first = 0, > 4b06a81f1 Eric W. Biederman 2012-05-19 @32 .count = 4294967295U, > 22d917d80 Eric W. Biederman 2011-11-17 33 }, > 22d917d80 Eric W. Biederman 2011-11-17 34 }, > 22d917d80 Eric W. Biederman 2011-11-17 35 .gid_map = { > 22d917d80 Eric W. Biederman 2011-11-17 36 .nr_extents = 1, > 22d917d80 Eric W. Biederman 2011-11-17 37 .extent[0] = { > 22d917d80 Eric W. Biederman 2011-11-17 38 .first = 0, > 22d917d80 Eric W. Biederman 2011-11-17 39 .lower_first = 0, > 4b06a81f1 Eric W. Biederman 2012-05-19 40 .count = 4294967295U, > 22d917d80 Eric W. Biederman 2011-11-17 41 }, > 22d917d80 Eric W. Biederman 2011-11-17 42 }, > f76d207a6 Eric W. Biederman 2012-08-30 43 .projid_map = { > f76d207a6 Eric W. Biederman 2012-08-30 44 .nr_extents = 1, > f76d207a6 Eric W. Biederman 2012-08-30 45 .extent[0] = { > f76d207a6 Eric W. Biederman 2012-08-30 46 .first = 0, > f76d207a6 Eric W. Biederman 2012-08-30 47 .lower_first = 0, > f76d207a6 Eric W. Biederman 2012-08-30 48 .count = 4294967295U, > f76d207a6 Eric W. Biederman 2012-08-30 49 }, > f76d207a6 Eric W. Biederman 2012-08-30 50 }, > c61a2810a Eric W. Biederman 2012-12-28 51 .count = ATOMIC_INIT(3), > 783291e69 Eric W. Biederman 2011-11-17 52 .owner = GLOBAL_ROOT_UID, > 783291e69 Eric W. Biederman 2011-11-17 53 .group = GLOBAL_ROOT_GID, > 435d5f4bb Al Viro 2014-10-31 54 .ns.inum = PROC_USER_INIT_INO, > 33c429405 Al Viro 2014-11-01 55 #ifdef CONFIG_USER_NS > 33c429405 Al Viro 2014-11-01 56 .ns.ops = &userns_operations, > 33c429405 Al Viro 2014-11-01 57 #endif > 9cc46516d Eric W. Biederman 2014-12-02 58 .flags = USERNS_INIT_FLAGS, > 6bd364d82 Xiao Guangrong 2013-12-13 59 #ifdef CONFIG_PERSISTENT_KEYRINGS > 6bd364d82 Xiao Guangrong 2013-12-13 60 .persistent_keyring_register_sem = > 6bd364d82 Xiao Guangrong 2013-12-13 61 __RWSEM_INITIALIZER(init_user_ns.persistent_keyring_register_sem), > f36f8c75a David Howells 2013-09-24 62 #endif > aee16ce73 Pavel Emelyanov 2008-02-08 63 }; > aee16ce73 Pavel Emelyanov 2008-02-08 64 EXPORT_SYMBOL_GPL(init_user_ns); > aee16ce73 Pavel Emelyanov 2008-02-08 65 > > :::::: The code at line 31 was first introduced by commit > :::::: 22d917d80e842829d0ca0a561967d728eb1d6303 userns: Rework the user_namespace adding uid/gid mapping support > > :::::: TO: Eric W. Biederman > :::::: CC: Eric W. Biederman > > --- > 0-DAY kernel test infrastructure Open Source Technology Center > https://lists.01.org/pipermail/kbuild-all Intel Corporation