public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Maoyi Xie <maoyixie.tju@gmail.com>
Cc: corbet@lwn.net, hannes@cmpxchg.org, mkoutny@suse.com,
	roman.gushchin@linux.dev, brauner@kernel.org,
	cgroups@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, security@kernel.org
Subject: Re: [PATCH] Documentation/cgroup-v2: warn about cgroup.kill / cgroup.freeze delegation
Date: Tue, 28 Apr 2026 06:17:14 -1000	[thread overview]
Message-ID: <afDdinJLH2H8nYfc@slm.duckdns.org> (raw)
In-Reply-To: <20260428072251.2464314-1-maoyixie.tju@gmail.com>

On Tue, Apr 28, 2026 at 03:22:51PM +0800, Maoyi Xie wrote:
> +	A write to cgroup.freeze affects every process currently in the
> +	cgroup or its descendants regardless of the writer's signal
> +	authority over those processes. The file therefore acts as a
> +	delegated stop knob: chowning it, or passing an open file
> +	descriptor to it, grants the recipient unconditional freeze
> +	authority over whatever lands in the subtree. Runtime authors
> +	should not delegate cgroup.freeze outside of the trust boundary
> +	of the cgroup itself.

For example, if you delegate a memory control file, whoever can write to it
can control memory distribution over everyone in the cgroup too regardless
of their UID. Here's an excerpt from "Model of Delegation" section:

  Because the resource control interface files in a given directory
  control the distribution of the parent's resources, the delegatee
  shouldn't be allowed to write to them.

These threads basically amount to "if I give SUID to bash, I get a root
shell". Please stop.

Thanks.

-- 
tejun

      reply	other threads:[~2026-04-28 16:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <ftvtv7lv6gh6tfzabant74ncmtqjuljr3xfjxn5evaehwzhy56@kuf4jiwchuie>
2026-04-28  7:22 ` [PATCH] Documentation/cgroup-v2: warn about cgroup.kill / cgroup.freeze delegation Maoyi Xie
2026-04-28 16:17   ` Tejun Heo [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=afDdinJLH2H8nYfc@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=brauner@kernel.org \
    --cc=cgroups@vger.kernel.org \
    --cc=corbet@lwn.net \
    --cc=hannes@cmpxchg.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maoyixie.tju@gmail.com \
    --cc=mkoutny@suse.com \
    --cc=roman.gushchin@linux.dev \
    --cc=security@kernel.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox