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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <deller@xxxxxx>

diff --git a/arch/parisc/include/asm/uaccess.h b/arch/parisc/include/asm/uaccess.h
index 63f4dd0..228fecb 100644
--- a/arch/parisc/include/asm/uaccess.h
+++ b/arch/parisc/include/asm/uaccess.h
@@ -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);
 }
 
 /**
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SoC]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux