unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Bengt Richter <bokr@bokr.com>
To: Vagrant Cascadian <vagrant@debian.org>
Cc: 45069@debbugs.gnu.org, Jesse Dowell <jesse.dowell@gmail.com>,
	Paul Garlick <pgarlick@tourbillion-technology.com>,
	Guix Devel <guix-devel@gnu.org>
Subject: Re: bug#45069: Guix System: unprivileged user cannot create user namespaces?
Date: Tue, 8 Dec 2020 04:20:05 +0100	[thread overview]
Message-ID: <20201208032005.GA14866@LionPure> (raw)
In-Reply-To: <87eek1sdpo.fsf@yucca>

Hi Vagrant,

On +2020-12-07 09:55:31 -0800, Vagrant Cascadian wrote:
> On 2020-12-07, zimoun wrote:
> > On Mon, 07 Dec 2020 at 18:13, Pierre Neidhardt <mail@ambrevar.xyz> wrote:
> >
> >>> Can you try, as root on Guix System:
> >>>
> >>> $ echo 1 > /proc/sys/kernel/unprivileged_userns_clone
> >>
> >> # echo 1 > /proc/sys/kernel/unprivileged_userns_clone
> >> -bash: /proc/sys/kernel/unprivileged_userns_clone: No such file or directory
> >
> > In gnu/build/linux-container.scm, it reads:
> >
> > --8<---------------cut here---------------start------------->8---
> > (define (unprivileged-user-namespace-supported?)
> >   "Return #t if user namespaces can be created by unprivileged users."
> >   (let ((userns-file "/proc/sys/kernel/unprivileged_userns_clone"))
> >     (if (file-exists? userns-file)
> >         (eqv? #\1 (call-with-input-file userns-file read-char))
> >         #t)))
> > --8<---------------cut here---------------end--------------->8---
> >
> > Does it mean that the Linux kernel on Guix System does not support
> > namespaces by unprivileged users?
> 
> > Turning #t to #f should work on Guix System and it appears to me a
> > severe bug if not.  What do I miss?  Please could someone fill my gap? :-)
> 
> The /proc/sys/kernel_unprivileged_userns_clone file is specific to
> Debian and Ubuntu packaged linux kernel; it is a patchset not applied
> upstream, as far as I am aware. I'm not sure if other distros support
> disabling and enabling this feature using this mechanism.
> 
>   https://salsa.debian.org/kernel-team/linux/-/blob/master/debian/patches/debian/add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by-default.patch
> 
> live well,
    and as virtuously as you are able ... so that spies can't help but admire and reflect :)
>   vagrant

Another data point FYI:

On my pureos system, which is based on debian upstream:
    uname -a
    =-> Linux LionPure 4.19.0-12-amd64 #1 SMP Debian 4.19.152-1 (2020-10-18) x86_64 GNU/Linux
and
    ls -l /proc/sys/kernel/unprivileged_userns_clone
        -rw-r--r-- 1 root root 0 Dec  8 03:03 /proc/sys/kernel/unprivileged_userns_clone

and (noticing that the items appear to be short and ascii lines, hence thereupon  head :)

--8<---------------cut here---------------start------------->8---
od -a -t x1 /proc/sys/kernel/unprivileged_userns_clone 
0000000   0  nl
         30  0a
0000002
head /proc/sys/kernel/unprivileged_userns_clone 
0
--8<---------------cut here---------------end--------------->8---

Not sure this tells you anything useful, but there is also:
--8<---------------cut here---------------start------------->8---
head /proc/sys/user/*
==> /proc/sys/user/max_cgroup_namespaces <==
128163

==> /proc/sys/user/max_inotify_instances <==
128

==> /proc/sys/user/max_inotify_watches <==
65536

==> /proc/sys/user/max_ipc_namespaces <==
128163

==> /proc/sys/user/max_mnt_namespaces <==
128163

==> /proc/sys/user/max_net_namespaces <==
128163

==> /proc/sys/user/max_pid_namespaces <==
128163

==> /proc/sys/user/max_user_namespaces <==
128163

==> /proc/sys/user/max_uts_namespaces <==
128163
--8<---------------cut here---------------end--------------->8---

HTH some way :)
-- 
Regards,
Bengt Richter


  parent reply	other threads:[~2020-12-08  3:21 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-04 15:52 guix environment: error: cannot create container: unprivileged user cannot create user namespaces yasu
2020-12-04 16:04 ` Ricardo Wurmus
2020-12-04 16:29   ` Yasuaki Kudo
2020-12-04 16:32 ` zimoun
2020-12-04 18:55   ` Pjotr Prins
2020-12-04 20:44     ` Yasuaki Kudo
2020-12-05  0:20     ` yasu
2020-12-06 12:41       ` BUG: " yasu
2020-12-06 16:16         ` bug#45069: " Tobias Geerinckx-Rice via Bug reports for GNU Guix
2020-12-06 16:56         ` zimoun
2020-12-06 20:51           ` yasu
2021-01-06 10:49             ` raingloom
2020-12-06 20:54           ` bug#45069: " Jesse Dowell
2020-12-07 11:57             ` Pierre Neidhardt
2020-12-07 12:29               ` Paul Garlick
2020-12-07 12:41                 ` Yasuaki Kudo
2020-12-07 17:13                 ` Pierre Neidhardt
2020-12-07 17:35                   ` bug#45069: Guix System: unprivileged user cannot create user namespaces? zimoun
2020-12-07 17:55                     ` Vagrant Cascadian
2020-12-07 20:03                       ` zimoun
2020-12-08  3:20                       ` Bengt Richter [this message]
2020-12-07 19:50                   ` bug#45069: BUG: Re: guix environment: error: cannot create container: unprivileged user cannot create user namespaces Paul Garlick
2020-12-07 20:35                     ` Pierre Neidhardt
2020-12-07 21:09                       ` zimoun
2021-01-04  9:11                       ` Pierre Neidhardt
2020-12-07 13:26               ` zimoun

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=20201208032005.GA14866@LionPure \
    --to=bokr@bokr.com \
    --cc=45069@debbugs.gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=jesse.dowell@gmail.com \
    --cc=pgarlick@tourbillion-technology.com \
    --cc=vagrant@debian.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).