mm-memcg-v1-account-event-registrations-and-drop-world-writable-cgroupevent_control.patch removed from -mm tree
The quilt patch titled
Subject: mm/memcg: v1: account event registrations and drop world-writable cgroup.event_control
has been removed from the -mm tree. Its filename was
mm-memcg-v1-account-event-registrations-and-drop-world-writable-cgroupevent_control.patch
This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Stanislav Fort <[email protected]>
Subject: mm/memcg: v1: account event registrations and drop world-writable cgroup.event_control
Date: Fri, 5 Sep 2025 12:38:51 +0300
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.
---
mm/memcontrol-v1.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
mm/memcontrol-v1.c renamed from mm/memcontrol-v1.c~mm-memcg-v1-account-event-registrations-and-drop-world-writable-cgroupevent_control +4 -4
@@ -761,7 +761,7 @@ static int __mem_cgroup_usage_register_e size = thresholds->primary ? thresholds->primary->size +1 :1 ;/* Allocate memory for new array of thresholds */ - new =kmalloc (struct_size (new, entries, size),GFP_KERNEL ); + new =kmalloc (struct_size (new, entries, size),GFP_KERNEL_ACCOUNT );if (!new) { ret = -ENOMEM ; goto unlock;
@@ -924,7 +924,7 @@ static int mem_cgroup_oom_register_event {struct mem_cgroup_eventfd_list *event; - event =kmalloc (sizeof (*event),GFP_KERNEL ); + event =kmalloc (sizeof (*event),GFP_KERNEL_ACCOUNT );if (!event)return -ENOMEM ;
@@ -1087,7 +1087,7 @@ static ssize_t memcg_write_event_controlCLASS (fd, cfile)(cfd); - event =kzalloc (sizeof (*event),GFP_KERNEL ); + event =kzalloc (sizeof (*event),GFP_KERNEL_ACCOUNT );if (!event)return -ENOMEM ;
@@ -2053,7 +2053,7 @@ struct cftype mem_cgroup_legacy_files[] { .name = "cgroup.event_control", /* XXX: for compat */ .write = memcg_write_event_control, - .flags = CFTYPE_NO_PREFIX | CFTYPE_WORLD_WRITABLE, + .flags = CFTYPE_NO_PREFIX, }, { .name = "swappiness",
_
Patches currently in -mm which might be from [email protected] are