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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 5 Apr 2018 08:40:05 -0700
From:   Linus Torvalds <>
To:     "Michael S. Tsirkin" <>,
        Al Viro <>
Cc:     Linux Kernel Mailing List <>,
        stable <>,,
        linux-mm <>,
        "Kirill A. Shutemov" <>,
        Andrew Morton <>,
        Huang Ying <>,
        Jonathan Corbet <>,
        Peter Zijlstra <>,
        Thomas Gleixner <>,
        Thorsten Leemhuis <>
Subject: Re: [PATCH] gup: return -EFAULT on access_ok failure

On Thu, Apr 5, 2018 at 7:17 AM, Michael S. Tsirkin <> wrote:
> I wonder however whether all the following should be changed then:
> static long __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
> ...
>                         if (!vma || check_vma_flags(vma, gup_flags))
>                                 return i ? : -EFAULT;
> is this a bug in __get_user_pages?

Note the difference between "get_user_pages()", and "get_user_pages_fast()".

It's the *fast* versions that just return the number of pages pinned.

The non-fast ones will return an error code for various cases.


The non-fast cases actually *have* various error cases. They can block
and get interrupted etc.

The fast cases are basically "just get me the pages, dammit, and if
you can't get some page, stop".

At least that's one excuse for the difference in behavior.

The real excuse is probably just "that's how it worked" - the fast
case just walked the page tables and that was it.


Powered by blists - more mailing lists