Skip to contentSkip to conversation

parisc: Fix commit 63379c1 parisc: implement full version of access_ok()

PATCH New Helge Deller 1 participant 1 message Nov 17, 2013 PA-RISC architecture

lore
Share & tools
lore

Helge Deller

author maintainer
#0 lore raw

PATCH 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.

arch/parisc/include/asm/uaccess.h +5 -1
index 63f4dd0..228fecb 100644
@@ -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);
 }
 
 /**