Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2269769imu; Tue, 6 Nov 2018 11:44:00 -0800 (PST) X-Google-Smtp-Source: AJdET5fV7pEPRPg+bxHR+8dNYg+myXy99FvhHKDVkOpKsUj7cQWmwksAwBwjKfpuYMHGMru+LDeX X-Received: by 2002:a17:902:8b8c:: with SMTP id ay12-v6mr26529100plb.69.1541533439982; Tue, 06 Nov 2018 11:43:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541533439; cv=none; d=google.com; s=arc-20160816; b=DAqdm7FEer8rWWsmPeQPcrf7Yu4/LMry33SAxOH/QP/wtqg6h4RCsmwMctK/8f6jyM fUSWIX+qFrOgGFsfcYYhA4eRFbKMUCslb+LJxtbeEI8jhUHGGKkmsiTEG4I9OFeNR2Sr KnGRAG+Ris/UJTXrWnDE+L4p1w3Jq3VD9aWCXY1YNkY6FlDUcXaeYliWQAVO9S/QkdE4 b2mBb54jswyqNcaEvEhsbxgJ6i+1OiEBHlgm/oebbRv5Dfu/6YuNAgL+zqZeP/tqRolX R6rKwCSWmdkvO13TRKUUXyIj79Ax7Sk4Rj7mmYSgLobfdBcHk5dorSrOlZU4xAq3jCl0 jBlw== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=O+AiFU8J1g1KbhypTcqxELFzGTEO5Pl3HZSpe23ehhM=; b=fiRAPhbWxOsso9JyZ7mt6+Tv2t9D+68bCg4qtu6BabhXWjJWF/S84Wh5EiOdEa7tw7 sEAXrDiz+KhuxCr0c/PvhICguC8buHBOE1dyRqnPvZMujDeUX/Cl+QIKkZX8CjBVbGaX 1J4QgqpPwwKlgj8p1GQl50N4dgjHBgPpo+CljYiCnYLpAGGDPUysDiL/1+W8uFiSmV23 ckfh+9Y2e8Y482x1b31wuZwMn5HotY6csIukjD4rHCVMin+/hzAN/ZCeNlyCRLXSg5XP rmuVGYs44j84vD6D0JDMnGYtZ9FhO9xCSgPw1vCZl3OnJDqFIJ8rpAD+Duy7halykP5/ 9vSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=rscT6LB2; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k69si4662247pga.176.2018.11.06.11.43.44; Tue, 06 Nov 2018 11:43:59 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=rscT6LB2; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726403AbeKGFIN (ORCPT + 99 others); Wed, 7 Nov 2018 00:08:13 -0500 Received: from mail-ot1-f66.google.com ([209.85.210.66]:32848 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725776AbeKGFIN (ORCPT ); Wed, 7 Nov 2018 00:08:13 -0500 Received: by mail-ot1-f66.google.com with SMTP id q1so12622153otk.0 for ; Tue, 06 Nov 2018 11:41:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=O+AiFU8J1g1KbhypTcqxELFzGTEO5Pl3HZSpe23ehhM=; b=rscT6LB2tFCca1i99jYKMH0T6O2yK1cNyEz1bBJBEdZNozwb2xXFt6ulTpfi7YG/Ae E0n/FnVnqlGDOdgB/8bsi7Oz0iJqjLbVwbwEjU+0vFWt0DLbddUhyA9t5s84sCS4pUf+ D7M8IRxpBS4Rmne984XJCpzYsgXfAv7jBbwH3/G4GgNGWOW3WPsKUdv1eKVhspbd/gP8 8mT2kCc6KWdGypILK6dyPBMCLhYEfUtfagAQchlkXqZch98SUa/iilfg2IayEeVYv1gI VXtqUMIb2fVEzNH4a2ouJ+E2WjGe26sAdi+ayCNHrFXlcwpVOzrRRe6hO0CpKQiXbmZs NcoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=O+AiFU8J1g1KbhypTcqxELFzGTEO5Pl3HZSpe23ehhM=; b=O2IipcsCAoFznyhhkjqA4l6IHf26mtYEhR69s5tovWmChC+DC8GF50EXzGQs+rZTd7 0UVXV9KbXPiKO9rUNtpZQDALVqXbh88zmg3uYawp2frA41V4UnNRpEnFLW4573EsgB2x MERgWAMLGjyL875HTXiS56IhuAgUNUE0CNreaOpwPkV4l+70IAcK0d4VSIP6iCycGkMw tnob9PV2wiecJuR1QGWTqL+8XK9sgLbHzWy/Pjl+yP4uyszsHtyju1965s5g9a8rqnqP fVwmd9gKViq/boeTegpbQ5UOkqc0nC2BsFIpnYIkp/OBd0DAO/BWgJypdNLb4xX7jgcj KthA== X-Gm-Message-State: AGRZ1gL1MR066eEERva/mYbqIhmq2JQkWRZqS9fdxXI4XjWxbYnQ68hu qwPaYc2InapwAx2BbG/Jm6xd5Q+y6qYvy+57Tt/iZA== X-Received: by 2002:a9d:17e8:: with SMTP id j95mr15641635otj.292.1541533284224; Tue, 06 Nov 2018 11:41:24 -0800 (PST) MIME-Version: 1.0 References: <20181010161430.11633-1-laurent@vivier.eu> <20181010161430.11633-2-laurent@vivier.eu> <20181016162245.GA7697@gmail.com> <0fb09ce6-e006-31a2-1f32-f3f6eda44504@vivier.eu> <4a1ec0cf-dce7-4193-6946-d46d63398c2d@vivier.eu> In-Reply-To: <4a1ec0cf-dce7-4193-6946-d46d63398c2d@vivier.eu> From: Jann Horn Date: Tue, 6 Nov 2018 20:40:57 +0100 Message-ID: Subject: Re: [PATCH v6 1/1] ns: add binfmt_misc to the user namespace To: Laurent Vivier , Andrew Morton Cc: "Eric W. Biederman" , Andrei Vagin , kernel list , James Bottomley , Linux API , linux-fsdevel@vger.kernel.org, Al Viro , containers@lists.linux-foundation.org, dima@arista.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 30, 2018 at 9:51 AM Laurent Vivier wrote: > Le 24/10/2018 =C3=A0 19:15, Laurent Vivier a =C3=A9crit : > > On 16/10/2018 17:22, Andrei Vagin wrote: > >> On Wed, Oct 10, 2018 at 06:14:30PM +0200, Laurent Vivier wrote: > >>> This patch allows to have a different binfmt_misc configuration > >>> for each new user namespace. By default, the binfmt_misc configuratio= n > >>> is the one of the previous level, but if the binfmt_misc filesystem i= s > >>> mounted in the new namespace a new empty binfmt instance is created a= nd > >>> used in this namespace. > >>> > >>> For instance, using "unshare" we can start a chroot of another > >>> architecture and configure the binfmt_misc interpreter without being = root > >>> to run the binaries in this chroot. > >>> > >>> Signed-off-by: Laurent Vivier > >> > >> Acked-by: Andrei Vagin > >> > >> Thanks, > >> Andrei > >> > > > > I don't konw who is the maintainer for this part, I think Andrew Morton is the right maintainer here. > > but is there any > > chance to have this merged in 4.20? > > > > I'd really want to have this merged. > > I have some real use cases for this: > > 1- to allow a non root user to run a container (with "unshare" for > instance) with its own binfmt_misc configuration. For instance, like we > provide a disk image and ask an ordinary user to run it with his > favorite VM hypervisor, we can provide a tar.gz containing our own > interpreter and just ask him to unshare+chroot to the exploded file tree, > > 2- to allow to run automatic tests of an interpreter on a machine > without having to change the global configuration of the system. I have > in mind to add some tests in Avocado to automatically test > qemu-linux-user in containers, so the interpreter path can depend on the > build path and possibly run them concurrently, > > 3- to select an interpreter by container. For instance, on the > qemu-devel mailing list, we have a waiting patch to add the bFLT > interpreter binfmt_misc configuration, but the bFLT doesn't provide the > CPU type in magic/mask. So it would be interesting to be able to select > also a bFLT interpreter by container, as we know the CPU architecture we > have in each chroot/container, > > 4- another example to select an interpreter by container is qemu-mips > and qemu-misn32 share the same magic/mask because only the kernel API > changes, so we can't configure both on the system (but I agree it's a > QEMU bug: they should be merged and the kernel API be selected at runtime= ).