mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christian Brauner <christian.brauner@ubuntu.com>
To: menglong8.dong@gmail.com
Cc: mcgrof@kernel.org, keescook@chromium.org, yzaikin@google.com,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	Yang Yang <yang.yang29@zte.com.cn>,
	Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH] sysctl: fix permission check while owner isn't GLOBAL_ROOT_UID
Date: Mon, 28 Jun 2021 14:17:29 +0200	[thread overview]
Message-ID: <20210628121729.xsbm63b5lxpsvhbu@wittgenstein> (raw)
In-Reply-To: <20210625083338.384184-1-yang.yang29@zte.com.cn>

On Fri, Jun 25, 2021 at 01:33:38AM -0700, menglong8.dong@gmail.com wrote:
> From: Yang Yang <yang.yang29@zte.com.cn>
> 
> With user namespace enabled, root in container can't modify
> /proc/sys/net/ipv4/ip_forward. While /proc/sys/net/ipv4/ip_forward
> belongs to root and mode is 644. Since root in container may
> be non-root in host, but test_perm() doesn't consider about it.

I'm confused about what the actual problem is tbh:

root@h3:~# stat -c "%A %a %n" /proc/sys/net/ipv4/ip_forward
-rw-r--r-- 644 /proc/sys/net/ipv4/ip_forward

root@h3:~# echo 0 > /proc/sys/net/ipv4/ip_forward

root@h3:~# cat /proc/sys/net/ipv4/ip_forward
0

root@h3:~# cat /proc/self/uid_map 
         0     100000 1000000000

Also, this patch changes the security requirements for all sysctls which
is unfortunately unacceptable.

  reply	other threads:[~2021-06-28 12:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-25  8:33 menglong8.dong
2021-06-28 12:17 ` Christian Brauner [this message]
     [not found]   ` <202106282114107052565@zte.com.cn>
2021-06-29 13:40     ` Christian Brauner

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=20210628121729.xsbm63b5lxpsvhbu@wittgenstein \
    --to=christian.brauner@ubuntu.com \
    --cc=keescook@chromium.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=menglong8.dong@gmail.com \
    --cc=yang.yang29@zte.com.cn \
    --cc=yzaikin@google.com \
    --cc=zealci@zte.com.cn \
    /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

all inboxes | Powered by JetHome®