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]
Date: Thu, 4 Apr 2024 09:11:52 +0200
From: Vlastimil Babka <vbabka@...e.cz>
To: Oscar Salvador <osalvador@...e.de>,
 Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
 Michal Hocko <mhocko@...e.com>, Marco Elver <elver@...gle.com>,
 Andrey Konovalov <andreyknvl@...il.com>,
 Alexander Potapenko <glider@...gle.com>,
 Alexandre Ghiti <alexghiti@...osinc.com>
Subject: Re: [PATCH v4 4/4] mm,page_owner: Fix printing of stack records

On 4/4/24 9:07 AM, Oscar Salvador wrote:
> When seq_* code sees that its buffer overflowed, it re-allocates a bigger
> onecand calls seq_operations->start() callback again.
> stack_start() naively though that if it got called again, it meant that the
> old record got already printed so it returned the next object, but that is
> not true.
> 
> The consequence of that is that every time stack_stop() -> stack_start()
> get called because we needed a bigger buffer, stack_start() will skip
> entries, and those will not be printed.
> 
> Fix it by not advancing to the next object in stack_start().
> 
> Fixes: 765973a09803 ("mm,page_owner: display all stacks and their count")
> Signed-off-by: Oscar Salvador <osalvador@...e.de>

Reviewed-by: Vlastimil Babka <vbabka@...e.cz>

> ---
>  mm/page_owner.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/mm/page_owner.c b/mm/page_owner.c
> index b4476f45b376..9bef0b442863 100644
> --- a/mm/page_owner.c
> +++ b/mm/page_owner.c
> @@ -872,13 +872,11 @@ static void *stack_start(struct seq_file *m, loff_t *ppos)
>  		 * value of stack_list.
>  		 */
>  		stack = smp_load_acquire(&stack_list);
> +		m->private = stack;
>  	} else {
>  		stack = m->private;
> -		stack = stack->next;
>  	}
>  
> -	m->private = stack;
> -
>  	return stack;
>  }
>  


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ