All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Mickaël Salaün" <mic@digikod.net>
To: Casey Schaufler <casey@schaufler-ca.com>,
	Al Viro <viro@zeniv.linux.org.uk>,
	James Morris <jmorris@namei.org>, Serge Hallyn <serge@hallyn.com>
Cc: Andy Lutomirski <luto@amacapital.net>,
	Christian Brauner <christian.brauner@ubuntu.com>,
	Christoph Hellwig <hch@lst.de>,
	David Howells <dhowells@redhat.com>,
	Dominik Brodowski <linux@dominikbrodowski.net>,
	Eric Biederman <ebiederm@xmission.com>,
	John Johansen <john.johansen@canonical.com>,
	Kees Cook <keescook@chromium.org>,
	Kentaro Takeda <takedakn@nttdata.co.jp>,
	Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
	kernel-hardening@lists.openwall.com,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-security-module@vger.kernel.org
Subject: Re: [PATCH v1 0/1] Unprivileged chroot
Date: Thu, 11 Mar 2021 11:42:55 +0100	[thread overview]
Message-ID: <a28100f5-19ca-adbf-7056-575f6bfc9dc6@digikod.net> (raw)
In-Reply-To: <0dfd4306-8e7c-239b-2829-d4103395ea44@schaufler-ca.com>


On 10/03/2021 21:59, Casey Schaufler wrote:
> On 3/10/2021 10:17 AM, Mickaël Salaün wrote:
>> On 10/03/2021 18:22, Casey Schaufler wrote:
>>> On 3/10/2021 8:09 AM, Mickaël Salaün wrote:
>>>> Hi,
>>>>
>>>> The chroot system call is currently limited to be used by processes with
>>>> the CAP_SYS_CHROOT capability.  This protects against malicious
>>>> procesess willing to trick SUID-like binaries.  The following patch
>>>> allows unprivileged users to safely use chroot(2).
>>> Mount namespaces have pretty well obsoleted chroot(). CAP_SYS_CHROOT is
>>> one of the few fine grained capabilities. We're still finding edge cases
>>> (e.g. ptrace) where no_new_privs is imperfect. I doesn't seem that there
>>> is a compelling reason to remove the privilege requirement on chroot().
>> What is the link between chroot and ptrace?
> 
> The possibility of sophisticated interactions with no_new_privs.

Would you mind giving some practical examples?

> 
>> What is interesting with CAP_SYS_CHROOT?
> 
> CAP_SYS_CHROOT is specific to chroot. It doesn't give you privilege
> beyond what you expect, unlike CAP_CHOWN or CAP_SYS_ADMIN. Making chroot
> unprivileged is silly when it's possibly the best example of how the
> capability mechanism is supposed to work.

Why would it be silly to make the use of this feature safe for any
processes instead of giving the right (with CAP_SYS_CHROOT) to some
processes to use it unsafely?

> 
>>
>>>> This patch is a follow-up of a previous one sent by Andy Lutomirski some
>>>> time ago:
>>>> https://lore.kernel.org/lkml/0e2f0f54e19bff53a3739ecfddb4ffa9a6dbde4d.1327858005.git.luto@amacapital.net/
>>>>
>>>> This patch can be applied on top of v5.12-rc2 .  I would really
>>>> appreciate constructive reviews.
>>>>
>>>> Regards,
>>>>
>>>> Mickaël Salaün (1):
>>>>   fs: Allow no_new_privs tasks to call chroot(2)
>>>>
>>>>  fs/open.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++---
>>>>  1 file changed, 61 insertions(+), 3 deletions(-)
>>>>
>>>>
>>>> base-commit: a38fd8748464831584a19438cbb3082b5a2dab15
> 

      reply	other threads:[~2021-03-11 10:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-10 16:09 [PATCH v1 0/1] Unprivileged chroot Mickaël Salaün
2021-03-10 16:10 ` [PATCH v1 1/1] fs: Allow no_new_privs tasks to call chroot(2) Mickaël Salaün
2021-03-10 16:56   ` Eric W. Biederman
2021-03-10 18:13     ` Mickaël Salaün
2021-03-10 17:22 ` [PATCH v1 0/1] Unprivileged chroot Casey Schaufler
2021-03-10 18:17   ` Mickaël Salaün
2021-03-10 20:59     ` Casey Schaufler
2021-03-11 10:42       ` Mickaël Salaün [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a28100f5-19ca-adbf-7056-575f6bfc9dc6@digikod.net \
    --to=mic@digikod.net \
    --cc=casey@schaufler-ca.com \
    --cc=christian.brauner@ubuntu.com \
    --cc=dhowells@redhat.com \
    --cc=ebiederm@xmission.com \
    --cc=hch@lst.de \
    --cc=jmorris@namei.org \
    --cc=john.johansen@canonical.com \
    --cc=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=linux@dominikbrodowski.net \
    --cc=luto@amacapital.net \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=serge@hallyn.com \
    --cc=takedakn@nttdata.co.jp \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.