access_ok() always returns 1.
Thanks for pointing it out. And, I didn't notice that gup is just built for SPARC64. I though it is built by both 64 bit and 32 bit.
A follow-up question, is there any reason to just have sparc specific fast gup for 64 bit not for 32 bit?
I do not know - sorry.
@@ -203,6 +206,8 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write, addr = start; len = (unsigned long) nr_pages << PAGE_SHIFT; end = start + len;
- if (end < start)
goto slow_irqon;
end can only be smaller than start if there is some overflow. See how end is calculated just the line above.
This looks like a highly suspicious change.
I'm supposed this is used to protect the overflow. I copied the code from other arch. Actually, every arch has this except sparc.
The the other archs are likely confused as well - there is most likely some history behind that can be found if digging a little.
The code is not present in the generic version.
Sam