From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757906AbbCDOAU (ORCPT ); Wed, 4 Mar 2015 09:00:20 -0500 Received: from mail-wi0-f180.google.com ([209.85.212.180]:35712 "EHLO mail-wi0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756745AbbCDOAQ (ORCPT ); Wed, 4 Mar 2015 09:00:16 -0500 Message-ID: <54F70FE1.60906@gmail.com> Date: Wed, 04 Mar 2015 15:00:01 +0100 From: "Michael Kerrisk (man-pages)" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Alban Crequy , "Eric W. Biederman" CC: mtk.manpages@gmail.com, Linux Containers , Josh Triplett , Andrew Morton , Kees Cook , Linux API , linux-man , "linux-kernel@vger.kernel.org" , LSM , Casey Schaufler , "Serge E. Hallyn" , Richard Weinberger , Kenton Varda , stable , Andy Lutomirski Subject: Re: [PATCH 2/2] user_namespaces.7: Update the documention to reflect the fixes for negative groups References: <52e0643bd47b1e5c65921d6e00aea1f724bb510a.1417281801.git.luto@amacapital.net> <87h9x5re41.fsf_-_@x220.int.ebiederm.org> <87mw6xpzb0.fsf_-_@x220.int.ebiederm.org> <87ppbtn4mv.fsf@x220.int.ebiederm.org> <87a92xn2io.fsf@x220.int.ebiederm.org> <87r3w8liw4.fsf@x220.int.ebiederm.org> <87iohklfvj.fsf_-_@x220.int.ebiederm.org> <87fvcok11h.fsf_-_@x220.int.ebiederm.org> <971ad3f6-90fd-4e3f-916c-8988af3c826d@email.android.com> <87wq5zf83t.fsf@x220.int.ebiederm.org> <87iohh3c9c.fsf@x220.int.ebiederm.org> <8761dh3b7k.fsf_-_@x220.int.ebiederm.org> <878uicy1r9.fsf_-_@x220.int.ebiederm.org> <87ppbo1ql4.fsf_-_@x220.int.ebiederm.org> In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/02/2015 10:31 PM, Alban Crequy wrote: > Hello, > > Thanks for updating the man page. > > On 12 December 2014 at 22:54, Eric W. Biederman wrote: > (...) >> Furthermore to preserve in some form the useful applications that have >> been setting gid_map without privilege the file /proc/[pid]/setgroups >> was added to allow disabling setgroups. With the setgroups system >> call permanently disabled in a user namespace it again becomes safe to >> allow writes to gid_map without privilege. >> >> Here is my meager attempt to update user_namespaces.7 to reflect these >> issues. > > The program userns_child_exec.c in user_namespaces.7 should be updated > to write in /proc/.../setgroups, near the line: > /* Update the UID and GID maps in the child */ > > Otherwise, the example given in the manpage does not work: > $ ./userns_child_exec -p -m -U -M '0 1000 1' -G '0 1000 1' bash Thanks, Alban. I've added code to the example to handle /proc/PID/setgroups (and tested). Cheers, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/