Re: [PATCH v2 5/8] memcg: accounting for fasync_cache
From: Shakeel Butt <hidden>
Date: 2021-03-15 16:30:55
Also in:
linux-mm
From: Shakeel Butt <hidden>
Date: 2021-03-15 16:30:55
Also in:
linux-mm
On Mon, Mar 15, 2021 at 5:23 AM Vasily Averin [off-list ref] wrote:
unprivileged user inside memcg-limited container can trigger creation of huge number of non-accounted fasync_struct objects
You need to make each patch of this series self-contained by including the motivation behind the series (just one or two sentences). For example, for this patch include what's the potential impact of these huge numbers of unaccounted fasync_struct objects?
--- fs/fcntl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)diff --git a/fs/fcntl.c b/fs/fcntl.c index dfc72f1..7941559 100644 --- a/fs/fcntl.c +++ b/fs/fcntl.c@@ -1049,7 +1049,8 @@ static int __init fcntl_init(void) __FMODE_EXEC | __FMODE_NONOTIFY)); fasync_cache = kmem_cache_create("fasync_cache", - sizeof(struct fasync_struct), 0, SLAB_PANIC, NULL); + sizeof(struct fasync_struct), 0, + SLAB_PANIC | SLAB_ACCOUNT, NULL); return 0; } --1.8.3.1