[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <03ccf64a-55ab-40b6-b9cd-74565df4bf34@suse.cz>
Date: Fri, 19 Dec 2025 09:58:13 +0100
From: Vlastimil Babka <vbabka@...e.cz>
To: ranxiaokai627@....com, akpm@...ux-foundation.org, surenb@...gle.com,
mhocko@...e.com, jackmanb@...gle.com, hannes@...xchg.org, ziy@...dia.com,
elver@...gle.com, andreyknvl@...il.com, =osalvador@...e.de
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org, ran.xiaokai@....com.cn
Subject: Re: [PATCH] mm/page_owner: fix memory leak in
page_owner_stack_fops->release()
On 12/19/25 08:42, ranxiaokai627@....com wrote:
> From: Ran Xiaokai <ran.xiaokai@....com.cn>
>
> The page_owner_stack_fops->open() callback invokes seq_open_private(),
> therefore its corresponding ->release() callback must call seq_release_private().
> Otherwise it will cause a memory leak of struct stack_print_ctx.
>
> Fixes: 765973a098037 ("mm,page_owner: display all stacks and their count")
I think cc: stable is warranted, Andrew can add it if he agrees.
> Signed-off-by: Ran Xiaokai <ran.xiaokai@....com.cn>
Acked-by: Vlastimil Babka <vbabka@...e.cz>
Thanks!
> ---
> mm/page_owner.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/page_owner.c b/mm/page_owner.c
> index 27d19f01009c..b6a394a130ec 100644
> --- a/mm/page_owner.c
> +++ b/mm/page_owner.c
> @@ -952,7 +952,7 @@ static const struct file_operations page_owner_stack_fops = {
> .open = page_owner_stack_open,
> .read = seq_read,
> .llseek = seq_lseek,
> - .release = seq_release,
> + .release = seq_release_private,
> };
>
> static int page_owner_threshold_get(void *data, u64 *val)
Powered by blists - more mailing lists