mm: gup: fix access_ok() argument type
Subsystems (2)
PATCH 1/1 mm: gup: fix access_ok() argument type
MIPS just got changed to only accept a pointer argument for access_ok(), causing one warning in drivers/scsi/pmcraid.c. I tried changing x86 the same way and found the same warning in __get_user_pages_fast() and nowhere else in the kernel during randconfig testing:
mm/gup.c: In function '__get_user_pages_fast':mm/gup.c:1578:6: error: passing argument 1 of '__chk_range_not_ok' makes pointer from integer without a cast [-Werror=int-conversion]
It would probably be a good idea to enforce type-safety in general, so let's change this file to not cause a warning if we do that.
I don't know why the warning did not appear on MIPS.
--- mm/gup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/gup.c +1 -1
@@ -1575,7 +1575,7 @@ int __get_user_pages_fast(unsigned long start, int nr_pages, int write, end = start + len;if (unlikely (!access_ok (write ?VERIFY_WRITE :VERIFY_READ , - start, len))) + (void __user *)start, len)))return 0 ;/*
Signature · 7 lines
2.9.0 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 4 lines · Arnd Bergmann
MIPS just got changed to only accept a pointer argument for
access_ok(), causing one warning indrivers/scsi/pmcraid.c. I tried changing x86 the same way and found the same warning in__get_user_pages_fast()and nowhere else in the kernel during randconfig testing:
Doing that for x86 access_ok() would definitely be a good idea.
Quoted 20 lines
mm/gup.c: In function '__get_user_pages_fast':mm/gup.c:1578:6: error: passing argument 1 of '__chk_range_not_ok' makes pointer from integer without a cast [-Werror=int-conversion]It would probably be a good idea to enforce type-safety in general, so let's change this file to not cause a warning if we do that.
I don't know why the warning did not appear on MIPS.
Fixes 2667f50e8b81 ("mm: introduce a general RCU get_user_pages_fast()")Cc Alexander Viro <[email protected]>Signed-off-by Arnd Bergmann <[email protected]>--- mm/gup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)mm/gup.c +0
-0
mm/gup.c int __get_user_pages_fast(unsigned long start, int nr_pages, int write, · line 1579
Quoted 6 lines
mm/gup.c +1
-1@@ -1575,7 +1575,7 @@ int __get_user_pages_fast(unsigned long start, int nr_pages, int write, end = start + len;if (unlikely (!access_ok (write ?VERIFY_WRITE :VERIFY_READ , - start, len))) + (void __user *)start, len)))return 0 ;
Thanks,
Ingo
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>