]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm: Account property blob allocations to memcg
authorXiao Kan <814091656@qq.com>
Wed, 14 Jan 2026 13:22:26 +0000 (08:22 -0500)
committerMaxime Ripard <mripard@kernel.org>
Fri, 16 Jan 2026 10:22:03 +0000 (11:22 +0100)
commit26b4309a3ab82a0697751cde52eb336c29c19035
tree0a292636057b4bbb9ee0f56fc363cca2fcc10dc2
parent64aa8b3a60a825134f7d866adf05c024bbe0c24c
drm: Account property blob allocations to memcg

DRM_IOCTL_MODE_CREATEPROPBLOB allows userspace to allocate arbitrary-sized
property blobs backed by kernel memory.

Currently, the blob data allocation is not accounted to the allocating
process's memory cgroup, allowing unprivileged users to trigger unbounded
kernel memory consumption and potentially cause system-wide OOM.

Mark the property blob data allocation with GFP_KERNEL_ACCOUNT so that the memory
is properly charged to the caller's memcg. This ensures existing cgroup
memory limits apply and prevents uncontrolled kernel memory growth without
introducing additional policy or per-file limits.

Signed-off-by: Xiao Kan <814091656@qq.com>
Signed-off-by: Xiao Kan <xiao.kan@samsung.com>
Link: https://patch.msgid.link/tencent_D12AA2DEDE6F359E1AF59405242FB7A5FD05@qq.com
Signed-off-by: Maxime Ripard <mripard@kernel.org>
drivers/gpu/drm/drm_property.c