2005-04-17 06:20:36 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
|
|
|
|
* Licensed under the GPL
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __SKAS_UACCESS_H
|
|
|
|
#define __SKAS_UACCESS_H
|
|
|
|
|
|
|
|
#include "asm/errno.h"
|
|
|
|
|
[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>
2005-11-14 08:07:13 +08:00
|
|
|
/* No SKAS-specific checking. */
|
|
|
|
#define access_ok_skas(type, addr, size) 0
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-09-10 00:15:13 +08:00
|
|
|
extern int copy_from_user_skas(void *to, const void __user *from, int n);
|
|
|
|
extern int copy_to_user_skas(void __user *to, const void *from, int n);
|
|
|
|
extern int strncpy_from_user_skas(char *dst, const char __user *src, int count);
|
|
|
|
extern int __clear_user_skas(void __user *mem, int len);
|
|
|
|
extern int clear_user_skas(void __user *mem, int len);
|
|
|
|
extern int strnlen_user_skas(const void __user *str, int len);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
#endif
|