* [PATCH] parisc: Fix commit 63379c1 parisc: implement full version of access_ok()
@ 2013-11-17 20:56 Helge Deller
0 siblings, 0 replies; only message in thread
From: Helge Deller @ 2013-11-17 20:56 UTC (permalink / raw)
To: linux-parisc, James Bottomley
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@gmx.de>
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);
}
/**
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-11-17 20:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-17 20:56 [PATCH] parisc: Fix commit 63379c1 parisc: implement full version of access_ok() Helge Deller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.