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: <60e83492-db02-4c73-1fd4-e1f2ba383cfe@redhat.com>
Date:   Mon, 9 Aug 2021 11:24:09 +0200
From:   David Hildenbrand <david@...hat.com>
To:     Miaohe Lin <linmiaohe@...wei.com>, akpm@...ux-foundation.org
Cc:     imbrenda@...ux.ibm.com, kirill.shutemov@...ux.intel.com,
        jack@...e.cz, jhubbard@...dia.com, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 5/5] mm: gup: use helper PAGE_ALIGNED in
 populate_vma_page_range()

On 07.08.21 11:36, Miaohe Lin wrote:
> Use helper PAGE_ALIGNED to check if address is aligned to PAGE_SIZE.
> Minor readability improvement.
> 
> Signed-off-by: Miaohe Lin <linmiaohe@...wei.com>
> ---
>   mm/gup.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/gup.c b/mm/gup.c
> index 8c89e614d4aa..802a3deb50cd 100644
> --- a/mm/gup.c
> +++ b/mm/gup.c
> @@ -1471,8 +1471,8 @@ long populate_vma_page_range(struct vm_area_struct *vma,
>   	unsigned long nr_pages = (end - start) / PAGE_SIZE;
>   	int gup_flags;
>   
> -	VM_BUG_ON(start & ~PAGE_MASK);
> -	VM_BUG_ON(end   & ~PAGE_MASK);
> +	VM_BUG_ON(!PAGE_ALIGNED(start));
> +	VM_BUG_ON(!PAGE_ALIGNED(end));
>   	VM_BUG_ON_VMA(start < vma->vm_start, vma);
>   	VM_BUG_ON_VMA(end   > vma->vm_end, vma);
>   	mmap_assert_locked(mm);
> 

Making it look more like faultin_vma_page_range(), nice :)

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

-- 
Thanks,

David / dhildenb

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ