parisc: Fix commit 63379c1 parisc: implement full version of access_ok()
Helge Deller
maintainerPATCH 1/1 parisc: Fix commit 63379c1 parisc: implement full version of access_ok()
Commit 63379c1 parisc: implement full version of access_ok() was incomplete and broke userspace. Fix it by checking if we really write to userspace.
Signed-off-by Helge Deller <[email protected]>
arch/parisc/include/asm/uaccess.h +5 -1
@@ -45,7 +45,11 @@ static inline int __range_not_ok(unsigned long addr, unsigned long size, unsigned long limit) {unsigned long __newaddr = addr + size; -return (__newaddr < addr || __newaddr > limit || size > limit); + +if (segment_eq (get_fs (),KERNEL_DS )) +return 0 ; + +return (addr <PAGE_SIZE || __newaddr > limit || size > limit); }/**