kernel-hardening.lists.openwall.com archive mirror
 help / color / mirror / Atom feed
From: "Mickaël Salaün" <mic@digikod.net>
To: Askar Safin <safinaskar@mail.ru>
Cc: kernel-hardening@lists.openwall.com,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-security-module@vger.kernel.org
Subject: Re: [PATCH v5 1/1] fs: Allow no_new_privs tasks to call chroot(2)
Date: Sat, 27 Mar 2021 19:56:23 +0100	[thread overview]
Message-ID: <7d9c2a08-89da-14ea-6550-527a3f2c9c9e@digikod.net> (raw)
In-Reply-To: <1616800362.522029786@f737.i.mail.ru>


On 27/03/2021 00:12, Askar Safin wrote:
> Hi. Unprivileged users already can do chroot. He should simply create userns and then call "chroot" inside. As an LWN commenter noted, you can simply run 
> "unshare -r /usr/sbin/chroot some-dir". (I recommend reading all comments: https://lwn.net/Articles/849125/ .)

We know that userns can be use to get the required capability in a new
namespace, but this patch is to not require to use this namespace, as
explained in the commit message. I already added some comments in the
LWN article though.

> 
> Also: if you need chroot for path resolving only, consider openat2 with RESOLVE_IN_ROOT ( https://lwn.net/Articles/796868/ ).

openat2 was also discussed in previous versions of this patch.

  reply	other threads:[~2021-03-27 18:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-26 23:12 [PATCH v5 1/1] fs: Allow no_new_privs tasks to call chroot(2) Askar Safin
2021-03-27 18:56 ` Mickaël Salaün [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-03-16 20:36 [PATCH v5 0/1] Unprivileged chroot Mickaël Salaün
2021-03-16 20:36 ` [PATCH v5 1/1] fs: Allow no_new_privs tasks to call chroot(2) Mickaël Salaün
2021-03-30 17:01   ` Mickaël Salaün
2021-03-30 17:19     ` Casey Schaufler
2021-03-30 18:11       ` Mickaël Salaün
2021-03-30 18:22         ` Casey Schaufler
2021-03-30 18:40         ` Casey Schaufler
2021-03-30 19:28           ` Mickaël Salaün
2021-03-30 22:53             ` Casey Schaufler
2021-03-31  6:03               ` Kees Cook
2021-03-31  6:33                 ` Al Viro

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=7d9c2a08-89da-14ea-6550-527a3f2c9c9e@digikod.net \
    --to=mic@digikod.net \
    --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=safinaskar@mail.ru \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).