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] [day] [month] [year] [list]
Date: Mon, 27 May 2024 09:33:27 +0200
From: David Hildenbrand <david@...hat.com>
To: Yuanyuan Zhong <yzhong@...estorage.com>,
 Andrew Morton <akpm@...ux-foundation.org>,
 Matthew Wilcox <willy@...radead.org>
Cc: linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
 Mohamed Khalfella <mkhalfella@...estorage.com>
Subject: Re: [PATCH] mm: /proc/pid/smaps_rollup: avoid skipping vma after
 getting mmap_lock again

Am 23.05.24 um 20:35 schrieb Yuanyuan Zhong:
> After switching smaps_rollup to use VMA iterator, searching for next
> entry is part of the condition expression of the do-while loop. So the
> current VMA needs to be addressed before the continue statement.
> 
> Fixes: c4c84f06285e ("fs/proc/task_mmu: stop using linked list and highest_vm_end")
> Signed-off-by: Yuanyuan Zhong <yzhong@...estorage.com>
> Reviewed-by: Mohamed Khalfella <mkhalfella@...estorage.com>
> ---
>   fs/proc/task_mmu.c | 9 +++++++--
>   1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
> index e5a5f015ff03..f8d35f993fe5 100644
> --- a/fs/proc/task_mmu.c
> +++ b/fs/proc/task_mmu.c
> @@ -970,12 +970,17 @@ static int show_smaps_rollup(struct seq_file *m, void *v)
>   				break;
>   
>   			/* Case 1 and 2 above */
> -			if (vma->vm_start >= last_vma_end)
> +			if (vma->vm_start >= last_vma_end) {
> +				smap_gather_stats(vma, &mss, 0);
> +				last_vma_end = vma->vm_end;
>   				continue;
> +			}
>   
>   			/* Case 4 above */
> -			if (vma->vm_end > last_vma_end)
> +			if (vma->vm_end > last_vma_end) {
>   				smap_gather_stats(vma, &mss, last_vma_end);
> +				last_vma_end = vma->vm_end;
> +			}
>   		}
>   	} for_each_vma(vmi, vma);
>   

Looks correct to me. I guess getting a reproducer is rather tricky.

Acked-by: David Hildenbrand <david@...hat.com>

-- 
Thanks,

David / dhildenb


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ