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: <debfe3d9-3d8b-af2a-de23-b927bd119e4e@oracle.com>
Date:   Wed, 10 Mar 2021 11:21:50 -0800
From:   Mike Kravetz <mike.kravetz@...cle.com>
To:     Peter Xu <peterx@...hat.com>, linux-kernel@...r.kernel.org,
        linux-mm@...ck.org
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Axel Rasmussen <axelrasmussen@...gle.com>,
        Naresh Kamboju <naresh.kamboju@...aro.org>
Subject: Re: [PATCH] mm/hugetlb: Fix build with !ARCH_WANT_HUGE_PMD_SHARE

On 3/10/21 10:53 AM, Peter Xu wrote:
> want_pmd_share() is undefined with !ARCH_WANT_HUGE_PMD_SHARE since it's put
> by accident into a "#ifdef ARCH_WANT_HUGE_PMD_SHARE" block.  Moving it out
> won't work either since vma_shareable() is only defined within the block.
> Define it for !ARCH_WANT_HUGE_PMD_SHARE instead.
> 
> Fixes: 5b109cc1cdcc ("hugetlb/userfaultfd: forbid huge pmd sharing when uffd enabled")

That commit id is from Andrew's tree and I don't think it is stable.
There is a different id in the next tree.  Not exactly sure how this is
supposed to be handled.

> Cc: Andrew Morton <akpm@...ux-foundation.org>
> Cc: Mike Kravetz <mike.kravetz@...cle.com>
> Cc: Axel Rasmussen <axelrasmussen@...gle.com>
> Reported-by: Naresh Kamboju <naresh.kamboju@...aro.org>
> Tested-by: Naresh Kamboju <naresh.kamboju@...aro.org>
> Signed-off-by: Peter Xu <peterx@...hat.com>
> ---
>  mm/hugetlb.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)

Thanks Peter,
Not your fault, but that header file is a bit of a mess.

Reviewed-by: Mike Kravetz <mike.kravetz@...cle.com>
-- 
Mike Kravetz

> 
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index d58f1456fe27..8dda7e034477 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -5469,9 +5469,6 @@ static bool vma_shareable(struct vm_area_struct *vma, unsigned long addr)
>  
>  bool want_pmd_share(struct vm_area_struct *vma, unsigned long addr)
>  {
> -#ifndef CONFIG_ARCH_WANT_HUGE_PMD_SHARE
> -	return false;
> -#endif
>  #ifdef CONFIG_USERFAULTFD
>  	if (uffd_disable_huge_pmd_share(vma))
>  		return false;
> @@ -5616,6 +5613,11 @@ void adjust_range_if_pmd_sharing_possible(struct vm_area_struct *vma,
>  				unsigned long *start, unsigned long *end)
>  {
>  }
> +
> +bool want_pmd_share(struct vm_area_struct *vma, unsigned long addr)
> +{
> +	return false;
> +}
>  #endif /* CONFIG_ARCH_WANT_HUGE_PMD_SHARE */
>  
>  #ifdef CONFIG_ARCH_WANT_GENERAL_HUGETLB
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ