From 81029b1f775ad55caeaa8f7f260273969a4a282e Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 3 Sep 2016 18:05:00 -0400 Subject: mn10300: finish verify_area() off Signed-off-by: Al Viro --- arch/mn10300/include/asm/uaccess.h | 6 ------ arch/mn10300/kernel/signal.c | 6 +++--- 2 files changed, 3 insertions(+), 9 deletions(-) (limited to 'arch/mn10300') diff --git a/arch/mn10300/include/asm/uaccess.h b/arch/mn10300/include/asm/uaccess.h index d012e877a95a..bd285e5fd93a 100644 --- a/arch/mn10300/include/asm/uaccess.h +++ b/arch/mn10300/include/asm/uaccess.h @@ -72,12 +72,6 @@ static inline int ___range_ok(unsigned long addr, unsigned int size) #define access_ok(type, addr, size) (__range_ok((addr), (size)) == 0) #define __access_ok(addr, size) (__range_ok((addr), (size)) == 0) -static inline int verify_area(int type, const void *addr, unsigned long size) -{ - return access_ok(type, addr, size) ? 0 : -EFAULT; -} - - /* * The exception table consists of pairs of addresses: the first is the * address of an instruction that is allowed to fault, and the second is diff --git a/arch/mn10300/kernel/signal.c b/arch/mn10300/kernel/signal.c index dfd0301cf200..cd8cb1d1176b 100644 --- a/arch/mn10300/kernel/signal.c +++ b/arch/mn10300/kernel/signal.c @@ -75,7 +75,7 @@ static int restore_sigcontext(struct pt_regs *regs, struct fpucontext *buf; err |= __get_user(buf, &sc->fpucontext); if (buf) { - if (verify_area(VERIFY_READ, buf, sizeof(*buf))) + if (!access_ok(VERIFY_READ, buf, sizeof(*buf))) goto badframe; err |= fpu_restore_sigcontext(buf); } @@ -98,7 +98,7 @@ asmlinkage long sys_sigreturn(void) long d0; frame = (struct sigframe __user *) current_frame()->sp; - if (verify_area(VERIFY_READ, frame, sizeof(*frame))) + if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) goto badframe; if (__get_user(set.sig[0], &frame->sc.oldmask)) goto badframe; @@ -130,7 +130,7 @@ asmlinkage long sys_rt_sigreturn(void) long d0; frame = (struct rt_sigframe __user *) current_frame()->sp; - if (verify_area(VERIFY_READ, frame, sizeof(*frame))) + if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) goto badframe; if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) goto badframe; -- cgit v1.2.3-70-g09d2 From 93b5097fe5b47d536b560fce14f4def3d1866121 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 3 Sep 2016 18:23:48 -0400 Subject: kill __kernel_ds_p off Signed-off-by: Al Viro --- arch/frv/include/asm/segment.h | 1 - arch/mn10300/include/asm/uaccess.h | 1 - 2 files changed, 2 deletions(-) (limited to 'arch/mn10300') diff --git a/arch/frv/include/asm/segment.h b/arch/frv/include/asm/segment.h index 4377c89a57f5..2305142d4cf8 100644 --- a/arch/frv/include/asm/segment.h +++ b/arch/frv/include/asm/segment.h @@ -32,7 +32,6 @@ typedef struct { #define get_ds() (KERNEL_DS) #define get_fs() (__current_thread_info->addr_limit) #define segment_eq(a, b) ((a).seg == (b).seg) -#define __kernel_ds_p() segment_eq(get_fs(), KERNEL_DS) #define get_addr_limit() (get_fs().seg) #define set_fs(_x) \ diff --git a/arch/mn10300/include/asm/uaccess.h b/arch/mn10300/include/asm/uaccess.h index bd285e5fd93a..2eedf6f46a57 100644 --- a/arch/mn10300/include/asm/uaccess.h +++ b/arch/mn10300/include/asm/uaccess.h @@ -38,7 +38,6 @@ #define get_ds() (KERNEL_DS) #define get_fs() (current_thread_info()->addr_limit) #define set_fs(x) (current_thread_info()->addr_limit = (x)) -#define __kernel_ds_p() (current_thread_info()->addr_limit.seg == 0x9FFFFFFF) #define segment_eq(a, b) ((a).seg == (b).seg) -- cgit v1.2.3-70-g09d2 From a31b821d8c189a6e6eee92f6c55989ce722e8089 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 4 Sep 2016 23:04:32 -0400 Subject: mn10300: remove a bogus processor.h->uaccess.h include The only reason it used to be needed had been a (bogus) use of set_fs() in start_thread() and that got removed in 2011... Signed-off-by: Al Viro --- arch/mn10300/include/asm/processor.h | 1 - 1 file changed, 1 deletion(-) (limited to 'arch/mn10300') diff --git a/arch/mn10300/include/asm/processor.h b/arch/mn10300/include/asm/processor.h index 769d5ed8e992..b10ba121c849 100644 --- a/arch/mn10300/include/asm/processor.h +++ b/arch/mn10300/include/asm/processor.h @@ -18,7 +18,6 @@ #include #include #include -#include #include /* Forward declaration, a strange C thing */ -- cgit v1.2.3-70-g09d2