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  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:   Fri, 21 Aug 2020 01:07:18 +0000
From:   "Song Bao Hua (Barry Song)" <song.bao.hua@...ilicon.com>
To:     Andrew Morton <akpm@...ux-foundation.org>,
        Naresh Kamboju <naresh.kamboju@...aro.org>
CC:     Linux-Next Mailing List <linux-next@...r.kernel.org>,
        open list <linux-kernel@...r.kernel.org>,
        linux-mm <linux-mm@...ck.org>,
        "lkft-triage@...ts.linaro.org" <lkft-triage@...ts.linaro.org>,
        Linuxarm <linuxarm@...wei.com>,
        John Hubbard <jhubbard@...dia.com>, Jan Kara <jack@...e.cz>,
        Jérôme Glisse <jglisse@...hat.com>,
        "Matthew Wilcox (Oracle)" <willy@...radead.org>,
        Al Viro <viro@...iv.linux.org.uk>,
        Christoph Hellwig <hch@...radead.org>,
        "Dan Williams" <dan.j.williams@...el.com>,
        Dave Chinner <david@...morbit.com>,
        Jason Gunthorpe <jgg@...pe.ca>,
        Jonathan Corbet <corbet@....net>,
        "Michal Hocko" <mhocko@...e.com>,
        Mike Kravetz <mike.kravetz@...cle.com>,
        Shuah Khan <shuah@...nel.org>, Vlastimil Babka <vbabka@...e.cz>
Subject: RE: mm/gup.c:1922:7: error: implicit declaration of function ‘is_valid_gup_flags’



> -----Original Message-----
> From: owner-linux-mm@...ck.org [mailto:owner-linux-mm@...ck.org] On
> Behalf Of Andrew Morton
> Sent: Friday, August 21, 2020 8:55 AM
> To: Naresh Kamboju <naresh.kamboju@...aro.org>
> Cc: Linux-Next Mailing List <linux-next@...r.kernel.org>; open list
> <linux-kernel@...r.kernel.org>; linux-mm <linux-mm@...ck.org>;
> lkft-triage@...ts.linaro.org; Linuxarm <linuxarm@...wei.com>; Song Bao Hua
> (Barry Song) <song.bao.hua@...ilicon.com>; John Hubbard
> <jhubbard@...dia.com>; Jan Kara <jack@...e.cz>; Jérôme Glisse
> <jglisse@...hat.com>; Matthew Wilcox (Oracle) <willy@...radead.org>; Al
> Viro <viro@...iv.linux.org.uk>; Christoph Hellwig <hch@...radead.org>; Dan
> Williams <dan.j.williams@...el.com>; Dave Chinner <david@...morbit.com>;
> Jason Gunthorpe <jgg@...pe.ca>; Jonathan Corbet <corbet@....net>; Michal
> Hocko <mhocko@...e.com>; Mike Kravetz <mike.kravetz@...cle.com>;
> Shuah Khan <shuah@...nel.org>; Vlastimil Babka <vbabka@...e.cz>
> Subject: Re: mm/gup.c:1922:7: error: implicit declaration of function
> ‘is_valid_gup_flags’
> 
> On Thu, 20 Aug 2020 14:59:52 +0530 Naresh Kamboju
> <naresh.kamboju@...aro.org> wrote:
> 
> > arm and riscv architecture build failed on linux next 20200820 tag.
> >
> > make -sk KBUILD_BUILD_USER=TuxBuild -C/linux -j16 ARCH=arm
> > CROSS_COMPILE=arm-linux-gnueabihf- HOSTCC=gcc CC="sccache
> > arm-linux-gnueabihf-gcc" O=build zImage
> >
> > 348#
> > 349../mm/gup.c: In function ‘get_user_pages’:
> > 350../mm/gup.c:1922:7: error: implicit declaration of function
> > ‘is_valid_gup_flags’ [-Werror=implicit-function-declaration]
> > 351 1922 | if (!is_valid_gup_flags(gup_flags))
> > 352 | ^~~~~~~~~~~~~~~~~~
> > 353cc1: some warnings being treated as errors
> >
> 
> Yes, thanks.
> 
> From: Andrew Morton <akpm@...ux-foundation.org>
> Subject:
> mm-gup-dont-permit-users-to-call-get_user_pages-with-foll_longterm-fix
> 
> fix CONFIG_MMU=n build
> 
> Link:
> https://lkml.kernel.org/r/CA+G9fYuNS3k0DVT62twfV746pfNhCSrk5sVMcOcQ1
> PGGnEseyw@...l.gmail.com
> Reported-by: Naresh Kamboju <naresh.kamboju@...aro.org>
> Cc: Barry Song <song.bao.hua@...ilicon.com>
> Cc: Stephen Rothwell <sfr@...b.auug.org.au>
> Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>

Andrew,
Thanks for taking care of this build issue.
Acked-by: Barry Song <song.bao.hua@...ilicon.com>

> ---
> 
>  mm/gup.c |   38 +++++++++++++++++++-------------------
>  1 file changed, 19 insertions(+), 19 deletions(-)
> 
> ---
> a/mm/gup.c~mm-gup-dont-permit-users-to-call-get_user_pages-with-foll_long
> term-fix
> +++ a/mm/gup.c
> @@ -1759,6 +1759,25 @@ static __always_inline long __gup_longte  }
> #endif /* CONFIG_FS_DAX || CONFIG_CMA */
> 
> +static bool is_valid_gup_flags(unsigned int gup_flags) {
> +	/*
> +	 * FOLL_PIN must only be set internally by the pin_user_pages*() APIs,
> +	 * never directly by the caller, so enforce that with an assertion:
> +	 */
> +	if (WARN_ON_ONCE(gup_flags & FOLL_PIN))
> +		return false;
> +	/*
> +	 * FOLL_PIN is a prerequisite to FOLL_LONGTERM. Another way of saying
> +	 * that is, FOLL_LONGTERM is a specific case, more restrictive case of
> +	 * FOLL_PIN.
> +	 */
> +	if (WARN_ON_ONCE(gup_flags & FOLL_LONGTERM))
> +		return false;
> +
> +	return true;
> +}
> +
>  #ifdef CONFIG_MMU
>  static long __get_user_pages_remote(struct mm_struct *mm,
>  				    unsigned long start, unsigned long nr_pages, @@
> -1789,25 +1808,6 @@ static long __get_user_pages_remote(stru
>  				       gup_flags | FOLL_TOUCH | FOLL_REMOTE);  }
> 
> -static bool is_valid_gup_flags(unsigned int gup_flags) -{
> -	/*
> -	 * FOLL_PIN must only be set internally by the pin_user_pages*() APIs,
> -	 * never directly by the caller, so enforce that with an assertion:
> -	 */
> -	if (WARN_ON_ONCE(gup_flags & FOLL_PIN))
> -		return false;
> -	/*
> -	 * FOLL_PIN is a prerequisite to FOLL_LONGTERM. Another way of saying
> -	 * that is, FOLL_LONGTERM is a specific case, more restrictive case of
> -	 * FOLL_PIN.
> -	 */
> -	if (WARN_ON_ONCE(gup_flags & FOLL_LONGTERM))
> -		return false;
> -
> -	return true;
> -}
> -
>  /**
>   * get_user_pages_remote() - pin user pages in memory
>   * @mm:		mm_struct of target mm
> _
> 

Best Regards
Barry

Powered by blists - more mailing lists