Received: by 10.223.185.116 with SMTP id b49csp807204wrg; Wed, 14 Feb 2018 07:17:35 -0800 (PST) X-Google-Smtp-Source: AH8x225hO5OcVzY95ONQCk2d73ZHyTMebs0PPx4xnzZNQevpVjyxFd0RNaUR5gKAezVBz309Bieo X-Received: by 10.98.171.12 with SMTP id p12mr5054276pff.71.1518621455085; Wed, 14 Feb 2018 07:17:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518621455; cv=none; d=google.com; s=arc-20160816; b=VsyOD8hHUOq44glob6npi+RcfUk52JETyzbDvvzgk5RSTKo4NoM8Y5M2/W7WEZJmQ4 LvlyjIvlKwkFqX2dG8D+VP0XfChIbYSnEZv2jATq3wdig6xnzFqFAQS/zyMS/UlKpYuY M2uq4vlevF5vlacl+3W2yNjnQCkNvfcD1wy0s3ZeiMLy6zzdxjY8vxU2S/8VPFfFrGTA dRi+LVHQFrbf1s0PDcY34KsUS3g4zVQ5jo2+lwQpMFqPdyRU5YGVqLJVDom27Tt2SBxq RjkVhy/cj9cL5wvJPmIe7hVdsfRsbPyG/5c9DCKtAivLECSoSa8nRDdSIeZqs/e8ptod caUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=kyb+qkpYdmm4JvD+lkVVJP3xAXNtYHbZf4McpyAMKmU=; b=lQ13/72D9gsVPVAUCHO2LRg9z1X51K+WRu4Y7ohEFpTfhZTBwndPsBfGx1lalpbq5Z z6hsaY70cJo+MQ1Z/t9ZclYrYhKRZPs2xVAeXARI32gda65CJQ4Ep+zP3eFEKCdL9KPx dIVXv06g24qG6BMj3ud6sJ96fQWA6jU5MYwCpHebDdbscB/0jj8Y818OX/I4mJ1HH+lN 1TVCHxxx1+hwvnA3fu6ShAnVu/sow9DoCU2xRCnCqatjLiSWTCF3WoqywQgSFLKYEIDj +JimbAFN//P84StAEC6Ll9oDhQIyLM4dbKWUHRzs/g029ebRdVujpZv10pxWR7LMJ3Aw B8nA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l190si1115773pfc.202.2018.02.14.07.17.16; Wed, 14 Feb 2018 07:17:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031201AbeBNPQW (ORCPT + 99 others); Wed, 14 Feb 2018 10:16:22 -0500 Received: from lilium.sigma-star.at ([109.75.188.150]:53330 "EHLO lilium.sigma-star.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030922AbeBNPQV (ORCPT ); Wed, 14 Feb 2018 10:16:21 -0500 Received: from localhost (localhost [127.0.0.1]) by lilium.sigma-star.at (Postfix) with ESMTP id 827C318000067; Wed, 14 Feb 2018 16:16:20 +0100 (CET) From: Richard Weinberger To: Enrico Weigelt Cc: Aleksa Sarai , Linux Containers , "linux-kernel@vger.kernel.org" Subject: Re: plan9 semantics on Linux - mount namespaces Date: Wed, 14 Feb 2018 16:17:35 +0100 Message-ID: <60748622.exvCVAzLTp@blindfold> In-Reply-To: <4f620eb7-c00c-487b-2e06-8cc4c97af38c@metux.net> References: <0f058286-a432-379b-f559-f2fe713807ab@metux.net> <2050418.Dl5pXkWGsk@blindfold> <4f620eb7-c00c-487b-2e06-8cc4c97af38c@metux.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Enrico, Am Mittwoch, 14. Februar 2018, 16:02:18 CET schrieb Enrico Weigelt: > stat64("/etc/busybox.conf", {st_mode=S_IFREG|0644, st_size=198, ...}) = 0 busybox... > brk(NULL) = 0x58000 > brk(0x79000) = 0x79000 > open("/etc/busybox.conf", O_RDONLY|O_LARGEFILE) = 3 > fstat64(3, {st_mode=S_IFREG|0644, st_size=198, ...}) = 0 > read(3, "[SUID]\n#lines starting with # ar"..., 1024) = 198 > read(3, "", 1024) = 0 > close(3) = 0 > getgid32() = 1 > setgid32(1) = 0 > setuid32(1) = 0 > geteuid32() = 1 > getegid32() = 1 > unshare(CLONE_NEWUTS|CLONE_NEWUSER) = 0 > open("/proc/self/setgroups", O_WRONLY|O_LARGEFILE) = 3 > write(3, "deny", 4) = 4 > close(3) = 0 > open("/proc/self/uid_map", O_WRONLY|O_LARGEFILE) = 3 > write(3, "1 0 1", 5) = -1 EPERM (Operation not permitted) This mapping looks broken. Please report to busybox folks. From taking a *very* quick look into busybox source, I suspect this should fix it: diff --git a/util-linux/unshare.c b/util-linux/unshare.c index 875e3f86e304..3f59cf4d27c2 100644 --- a/util-linux/unshare.c +++ b/util-linux/unshare.c @@ -350,9 +350,9 @@ int unshare_main(int argc UNUSED_PARAM, char **argv) * in that user namespace. */ xopen_xwrite_close(PATH_PROC_SETGROUPS, "deny"); - sprintf(uidmap_buf, "%u 0 1", (unsigned)reuid); + sprintf(uidmap_buf, "0 %u 1", (unsigned)reuid); xopen_xwrite_close(PATH_PROC_UIDMAP, uidmap_buf); - sprintf(uidmap_buf, "%u 0 1", (unsigned)regid); + sprintf(uidmap_buf, "0 %u 1", (unsigned)regid); xopen_xwrite_close(PATH_PROC_GIDMAP, uidmap_buf); } else if (setgrp_str) { Thanks, //richard -- sigma star gmbh - Eduard-Bodem-Gasse 6 - 6020 Innsbruck - Austria ATU66964118 - FN 374287y