Quantcast
Channel: lkml.org : Pallipadi, Venkatesh
Viewing all articles
Browse latest Browse all 864

Re: [PATCH] gup: return -EFAULT on access_ok failure

$
0
0
Linus Torvalds writes: (Summary) wrote:

[...]

through the vhost tree unless someone objects.
NAK.
NAK.
__get_user_pages_fast() returns the number of pages it gets. It has never returned an error code, and all the other versions of it (architecture-specific) don't either.
(architecture-specific) don't either.
If you ask for one page, and get zero pages, then that's an -EFAULT. Fix the docs, and fix the users.
docs, and fix the users.
The correct use has always been to check the number of pages returned. The actual get_user_pages() function itself is expressly being careful *not* to return an error code, it even has a comment to the effect ("Have to be a bit careful with return values").

Viewing all articles
Browse latest Browse all 864

Trending Articles