From: Stanislav Fort <stanislav.fort@aisle.com>
To: Shakeel Butt <shakeel.butt@linux.dev>
Cc: linux-mm@kvack.org, cgroups@vger.kernel.org,
linux-kernel@vger.kernel.org, hannes@cmpxchg.org,
mhocko@kernel.org, roman.gushchin@linux.dev,
muchun.song@linux.dev, akpm@linux-foundation.org,
stable@vger.kernel.org, Stanislav Fort <disclosure@aisle.com>
Subject: Re: [PATCH] mm/memcg: v1: account event registrations and drop world-writable cgroup.event_control
Date: Fri, 5 Sep 2025 12:44:21 +0300 [thread overview]
Message-ID: <CA+uRpKSm_u_RDrR8nP5DFFeV4vy5vT4tp1xX=rVNd-ehTCzkMw@mail.gmail.com> (raw)
In-Reply-To: <sa4mytppu6dfpquytx6jwdvak7bkyruztnr27vibbzhux2rjsl@pnrxdi5ecua3>
[-- Attachment #1: Type: text/plain, Size: 1628 bytes --]
Hi Roman, Shakeel, Johannes, and all,
Thanks for the quick reviews and acks.
I’ve sent v2 switching to GFP_KERNEL_ACCOUNT in all three allocations.
Otherwise unchanged.
Link: https://lore.kernel.org/all/aLqvzCiPCGzA5eYo@b7823f61de85/T/#t
If you’d like me to respin to restore any tags into the commit message
(e.g., Acked-by: Johannes, Reported-by, Cc: stable) instead of adding them
while applying, I’m happy to send a trivial v3.
Let me know if this looks good.
Best wishes,
Stanislav Fort
Aisle Research
On Fri, Sep 5, 2025 at 2:46 AM Shakeel Butt <shakeel.butt@linux.dev> wrote:
> On Thu, Sep 04, 2025 at 09:12:48PM +0300, Stanislav Fort wrote:
> > In cgroup v1, the legacy cgroup.event_control file is world-writable and
> allows unprivileged users to register unbounded events and thresholds. Each
> registration allocates kernel memory without capping or memcg charging,
> which can be abused to exhaust kernel memory in affected configurations.
> >
> > Make the following minimal changes:
> > - Account allocations with __GFP_ACCOUNT in event and threshold
> registration.
> > - Remove CFTYPE_WORLD_WRITABLE from cgroup.event_control to make it
> owner-writable.
> >
> > This does not affect cgroup v2. Allocations are still subject to kmem
> accounting being enabled, but this reduces unbounded global growth.
> >
> > Reported-by: Stanislav Fort <disclosure@aisle.com>
> > Acked-by: Johannes Weiner <hannes@cmpxchg.org>
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Stanislav Fort <disclosure@aisle.com>
>
> Acked-by: Shakeel Butt <shakeel.butt@linux.dev>
>
[-- Attachment #2: Type: text/html, Size: 2432 bytes --]
next prev parent reply other threads:[~2025-09-05 9:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-04 18:12 Stanislav Fort
2025-09-04 18:33 ` Roman Gushchin
2025-09-04 23:46 ` Shakeel Butt
2025-09-05 9:44 ` Stanislav Fort [this message]
2025-09-05 9:38 ` Stanislav Fort
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='CA+uRpKSm_u_RDrR8nP5DFFeV4vy5vT4tp1xX=rVNd-ehTCzkMw@mail.gmail.com' \
--to=stanislav.fort@aisle.com \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=disclosure@aisle.com \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=muchun.song@linux.dev \
--cc=roman.gushchin@linux.dev \
--cc=shakeel.butt@linux.dev \
--cc=stable@vger.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