From mboxrd@z Thu Jan 1 00:00:00 1970 From: ebiederm@xmission.com (Eric W. Biederman) Subject: Re: [PATCH RFC 04/12] userns: Convert cifs to use kuid/kgid where appropriate Date: Tue, 20 Nov 2012 09:22:42 -0800 Message-ID: <87lidwqjdp.fsf@xmission.com> References: <87pq38wimv.fsf@xmission.com> <1353415420-5457-1-git-send-email-ebiederm@xmission.com> <1353415420-5457-4-git-send-email-ebiederm@xmission.com> Mime-Version: 1.0 Content-Type: text/plain Cc: linux-fsdevel@vger.kernel.org, Linux Containers , linux-kernel@vger.kernel.org, "Serge E. Hallyn" , Steve French To: Steve French Return-path: Received: from out01.mta.xmission.com ([166.70.13.231]:40154 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751876Ab2KTRW7 (ORCPT ); Tue, 20 Nov 2012 12:22:59 -0500 In-Reply-To: (Steve French's message of "Tue, 20 Nov 2012 10:56:40 -0600") Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Steve French writes: > Do you have a pointer to the background on kuid/kgid You might try this lwn article https://lwn.net/Articles/491310/ In a nutshell each user namespace has it's own view of uid_t and gid_t values. Those values are mapped into kernel internal kuid_t and kgid_t values. Then user space interfaces convert from kuid_t and kgid_t when read from userspace. The initial user namespace as a 1-1 identity mapping between kuid_t and uid_t values. kuid_t and kgid_t are not assignment compatible with uid_t and gid_t so that if the conversions are left out a compile error results. My strategy is to push kuid_t and kgid_t values as deeply into the kernel data structures as possible so that there is a high propbability that when we get it wrong a compile error will happen. Eric