lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aUUPpBDSfq82Wdlh@tiehlicka>
Date: Fri, 19 Dec 2025 09:41:08 +0100
From: Michal Hocko <mhocko@...e.com>
To: ranxiaokai627@....com
Cc: akpm@...ux-foundation.org, vbabka@...e.cz, surenb@...gle.com,
	jackmanb@...gle.com, hannes@...xchg.org, ziy@...dia.com,
	elver@...gle.com, andreyknvl@...il.com, =osalvador@...e.de,
	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 Fri 19-12-25 07:42:32, 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")
> Signed-off-by: Ran Xiaokai <ran.xiaokai@....com.cn>

Acked-by: Michal Hocko <mhocko@...e.com>
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)
> -- 
> 2.25.1

-- 
Michal Hocko
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ