summaryrefslogtreecommitdiff
path: root/security/landlock/domain.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/landlock/domain.c')
-rw-r--r--security/landlock/domain.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/security/landlock/domain.c b/security/landlock/domain.c
index 06b6bd845060..04b69b43fbf5 100644
--- a/security/landlock/domain.c
+++ b/security/landlock/domain.c
@@ -90,11 +90,12 @@ static struct landlock_details *get_current_details(void)
return ERR_CAST(buffer);
/*
- * Create the new details according to the path's length. Do not
- * allocate with GFP_KERNEL_ACCOUNT because it is independent from the
- * caller.
+ * Create the new details according to the path's length. Account to
+ * the calling task's memcg, like the other Landlock per-domain
+ * allocations, even if it may not control the related size.
*/
- details = kzalloc_flex(*details, exe_path, path_size);
+ details =
+ kzalloc_flex(*details, exe_path, path_size, GFP_KERNEL_ACCOUNT);
if (!details)
return ERR_PTR(-ENOMEM);