mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-23 18:07:03 +00:00
score: switch to RAW_COPY_USER
... and kill copy_in_user() - it's not a biarch architecture, to start with Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
4b4554f6d5
commit
dc14253523
@ -15,6 +15,7 @@ config SCORE
|
||||
select MODULES_USE_ELF_REL
|
||||
select CLONE_BACKWARDS
|
||||
select CPU_NO_EFFICIENT_FFS
|
||||
select ARCH_HAS_RAW_COPY_USER
|
||||
|
||||
choice
|
||||
prompt "System type"
|
||||
|
@ -295,61 +295,19 @@ extern void __put_user_unknown(void);
|
||||
extern int __copy_tofrom_user(void *to, const void *from, unsigned long len);
|
||||
|
||||
static inline unsigned long
|
||||
copy_from_user(void *to, const void *from, unsigned long len)
|
||||
raw_copy_from_user(void *to, const void __user *from, unsigned long len)
|
||||
{
|
||||
unsigned long res = len;
|
||||
|
||||
if (likely(access_ok(VERIFY_READ, from, len)))
|
||||
res = __copy_tofrom_user(to, from, len);
|
||||
|
||||
if (unlikely(res))
|
||||
memset(to + (len - res), 0, res);
|
||||
|
||||
return res;
|
||||
return __copy_tofrom_user(to, (__force const void *)from, len);
|
||||
}
|
||||
|
||||
static inline unsigned long
|
||||
copy_to_user(void *to, const void *from, unsigned long len)
|
||||
raw_copy_to_user(void __user *to, const void *from, unsigned long len)
|
||||
{
|
||||
if (likely(access_ok(VERIFY_WRITE, to, len)))
|
||||
len = __copy_tofrom_user(to, from, len);
|
||||
|
||||
return len;
|
||||
return __copy_tofrom_user((__force void *)to, from, len);
|
||||
}
|
||||
|
||||
static inline unsigned long
|
||||
__copy_from_user(void *to, const void *from, unsigned long len)
|
||||
{
|
||||
unsigned long left = __copy_tofrom_user(to, from, len);
|
||||
if (unlikely(left))
|
||||
memset(to + (len - left), 0, left);
|
||||
return left;
|
||||
}
|
||||
|
||||
#define __copy_to_user(to, from, len) \
|
||||
__copy_tofrom_user((to), (from), (len))
|
||||
|
||||
static inline unsigned long
|
||||
__copy_to_user_inatomic(void *to, const void *from, unsigned long len)
|
||||
{
|
||||
return __copy_to_user(to, from, len);
|
||||
}
|
||||
|
||||
static inline unsigned long
|
||||
__copy_from_user_inatomic(void *to, const void *from, unsigned long len)
|
||||
{
|
||||
return __copy_tofrom_user(to, from, len);
|
||||
}
|
||||
|
||||
#define __copy_in_user(to, from, len) __copy_tofrom_user(to, from, len)
|
||||
|
||||
static inline unsigned long
|
||||
copy_in_user(void *to, const void *from, unsigned long len)
|
||||
{
|
||||
if (access_ok(VERIFY_READ, from, len) &&
|
||||
access_ok(VERIFY_WRITE, to, len))
|
||||
return __copy_tofrom_user(to, from, len);
|
||||
}
|
||||
#define INLINE_COPY_FROM_USER
|
||||
#define INLINE_COPY_TO_USER
|
||||
|
||||
/*
|
||||
* __clear_user: - Zero a block of memory in user space, with less checking.
|
||||
|
Loading…
Reference in New Issue
Block a user