aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/kernel/skas/uaccess.c
diff options
context:
space:
mode:
authorPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>2005-11-13 19:07:13 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-13 21:14:15 -0500
commit7a590611c0f1e1302c58fdfdc958f2d6bdddd78a (patch)
treead57f5bda5245af1d03ba10e15308487b1aae9c7 /arch/um/kernel/skas/uaccess.c
parent55c033c1f6cdedc350c79c3198b542e3ab496899 (diff)
[PATCH] uml: fix access_ok
The access_ok_tt() macro is bogus, in that a read access is unconditionally considered valid. I couldn't find in SCM logs the introduction of this check, but I went back to 2.4.20-1um and the definition was the same. Possibly this was done to avoid problems with missing set_fs() calls, but there can't be any I think because they would fail with SKAS mode. TT-specific code is still to check. Also, this patch joins common code together, and makes the "address range wrapping" check happen for all cases, rather than for only some. This may, possibly, be reoptimized at some time, but the current code doesn't seem clever, just confused. * Important: I've also had to change references to access_ok_{tt,skas} back to access_ok - the kernel wasn't that happy otherwise. Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Acked-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/kernel/skas/uaccess.c')
-rw-r--r--arch/um/kernel/skas/uaccess.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/um/kernel/skas/uaccess.c b/arch/um/kernel/skas/uaccess.c
index 75195281081e..a5a47528dec7 100644
--- a/arch/um/kernel/skas/uaccess.c
+++ b/arch/um/kernel/skas/uaccess.c
@@ -143,7 +143,7 @@ int copy_from_user_skas(void *to, const void __user *from, int n)
143 return(0); 143 return(0);
144 } 144 }
145 145
146 return(access_ok_skas(VERIFY_READ, from, n) ? 146 return(access_ok(VERIFY_READ, from, n) ?
147 buffer_op((unsigned long) from, n, 0, copy_chunk_from_user, &to): 147 buffer_op((unsigned long) from, n, 0, copy_chunk_from_user, &to):
148 n); 148 n);
149} 149}
@@ -164,7 +164,7 @@ int copy_to_user_skas(void __user *to, const void *from, int n)
164 return(0); 164 return(0);
165 } 165 }
166 166
167 return(access_ok_skas(VERIFY_WRITE, to, n) ? 167 return(access_ok(VERIFY_WRITE, to, n) ?
168 buffer_op((unsigned long) to, n, 1, copy_chunk_to_user, &from) : 168 buffer_op((unsigned long) to, n, 1, copy_chunk_to_user, &from) :
169 n); 169 n);
170} 170}
@@ -193,7 +193,7 @@ int strncpy_from_user_skas(char *dst, const char __user *src, int count)
193 return(strnlen(dst, count)); 193 return(strnlen(dst, count));
194 } 194 }
195 195
196 if(!access_ok_skas(VERIFY_READ, src, 1)) 196 if(!access_ok(VERIFY_READ, src, 1))
197 return(-EFAULT); 197 return(-EFAULT);
198 198
199 n = buffer_op((unsigned long) src, count, 0, strncpy_chunk_from_user, 199 n = buffer_op((unsigned long) src, count, 0, strncpy_chunk_from_user,
@@ -221,7 +221,7 @@ int clear_user_skas(void __user *mem, int len)
221 return(0); 221 return(0);
222 } 222 }
223 223
224 return(access_ok_skas(VERIFY_WRITE, mem, len) ? 224 return(access_ok(VERIFY_WRITE, mem, len) ?
225 buffer_op((unsigned long) mem, len, 1, clear_chunk, NULL) : len); 225 buffer_op((unsigned long) mem, len, 1, clear_chunk, NULL) : len);
226} 226}
227 227