From 5e6039d8a307d8411422c154f3d446b44fa32b6d Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 27 Dec 2016 18:00:15 -0500 Subject: uaccess: move VERIFY_{READ,WRITE} definitions to linux/uaccess.h Signed-off-by: Al Viro --- arch/score/include/asm/uaccess.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'arch/score/include') diff --git a/arch/score/include/asm/uaccess.h b/arch/score/include/asm/uaccess.h index db58ab98ec4b..51914244e867 100644 --- a/arch/score/include/asm/uaccess.h +++ b/arch/score/include/asm/uaccess.h @@ -6,9 +6,6 @@ #include #include -#define VERIFY_READ 0 -#define VERIFY_WRITE 1 - #define get_ds() (KERNEL_DS) #define get_fs() (current_thread_info()->addr_limit) #define segment_eq(a, b) ((a).seg == (b).seg) -- cgit v1.2.3 From af1d5b37d6211c814fac0d5d0b71ec695618054a Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 27 Dec 2016 18:14:09 -0500 Subject: uaccess: drop duplicate includes from asm/uaccess.h Signed-off-by: Al Viro --- arch/score/include/asm/uaccess.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'arch/score/include') diff --git a/arch/score/include/asm/uaccess.h b/arch/score/include/asm/uaccess.h index 51914244e867..7a6c6982420a 100644 --- a/arch/score/include/asm/uaccess.h +++ b/arch/score/include/asm/uaccess.h @@ -2,8 +2,6 @@ #define __SCORE_UACCESS_H #include -#include -#include #include #define get_ds() (KERNEL_DS) -- cgit v1.2.3 From 9849a5697d3defb2087cb6b9be5573a142697889 Mon Sep 17 00:00:00 2001 From: "Kirill A. Shutemov" Date: Thu, 9 Mar 2017 17:24:05 +0300 Subject: arch, mm: convert all architectures to use 5level-fixup.h If an architecture uses 4level-fixup.h we don't need to do anything as it includes 5level-fixup.h. If an architecture uses pgtable-nop*d.h, define __ARCH_USE_5LEVEL_HACK before inclusion of the header. It makes asm-generic code to use 5level-fixup.h. If an architecture has 4-level paging or folds levels on its own, include 5level-fixup.h directly. Signed-off-by: Kirill A. Shutemov Acked-by: Michal Hocko Signed-off-by: Linus Torvalds --- arch/score/include/asm/pgtable.h | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/score/include') diff --git a/arch/score/include/asm/pgtable.h b/arch/score/include/asm/pgtable.h index 0553e5cd5985..46ff8fd678a7 100644 --- a/arch/score/include/asm/pgtable.h +++ b/arch/score/include/asm/pgtable.h @@ -2,6 +2,7 @@ #define _ASM_SCORE_PGTABLE_H #include +#define __ARCH_USE_5LEVEL_HACK #include #include -- cgit v1.2.3 From 271abdc367e204821e19d71ae2bbc444059c8496 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 25 Dec 2016 03:33:03 -0500 Subject: score: switch to generic extable.h Signed-off-by: Al Viro --- arch/score/include/asm/Kbuild | 1 + arch/score/include/asm/extable.h | 11 ----------- 2 files changed, 1 insertion(+), 11 deletions(-) delete mode 100644 arch/score/include/asm/extable.h (limited to 'arch/score/include') diff --git a/arch/score/include/asm/Kbuild b/arch/score/include/asm/Kbuild index 926943a49ea5..e3a8d0f96652 100644 --- a/arch/score/include/asm/Kbuild +++ b/arch/score/include/asm/Kbuild @@ -4,6 +4,7 @@ header-y += generic-y += barrier.h generic-y += clkdev.h generic-y += current.h +generic-y += extable.h generic-y += irq_work.h generic-y += mcs_spinlock.h generic-y += mm-arch-hooks.h diff --git a/arch/score/include/asm/extable.h b/arch/score/include/asm/extable.h deleted file mode 100644 index c4423ccf830d..000000000000 --- a/arch/score/include/asm/extable.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef _ASM_SCORE_EXTABLE_H -#define _ASM_SCORE_EXTABLE_H - -struct exception_table_entry { - unsigned long insn; - unsigned long fixup; -}; - -struct pt_regs; -extern int fixup_exception(struct pt_regs *regs); -#endif -- cgit v1.2.3 From 4b4554f6d562c15159b053fad4146ced2201bc4c Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 27 Dec 2016 14:50:40 -0500 Subject: score: it's "VERIFY_WRITE", not "VERFITY_WRITE"... ... and the only reason it worked is that access_ok() discards the first argument before parser even gets a chance of looking at it. Still, no point keeping that typo. Signed-off-by: Al Viro --- arch/score/include/asm/uaccess.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/score/include') diff --git a/arch/score/include/asm/uaccess.h b/arch/score/include/asm/uaccess.h index 7a6c6982420a..79125fa6ed43 100644 --- a/arch/score/include/asm/uaccess.h +++ b/arch/score/include/asm/uaccess.h @@ -347,7 +347,7 @@ static inline unsigned long copy_in_user(void *to, const void *from, unsigned long len) { if (access_ok(VERIFY_READ, from, len) && - access_ok(VERFITY_WRITE, to, len)) + access_ok(VERIFY_WRITE, to, len)) return __copy_tofrom_user(to, from, len); } -- cgit v1.2.3 From dc1425352325bf8a56f5d8ecd1258671808bcadd Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 22 Mar 2017 13:26:57 -0400 Subject: 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 --- arch/score/include/asm/uaccess.h | 54 +++++----------------------------------- 1 file changed, 6 insertions(+), 48 deletions(-) (limited to 'arch/score/include') diff --git a/arch/score/include/asm/uaccess.h b/arch/score/include/asm/uaccess.h index 79125fa6ed43..916e5dbf0bfd 100644 --- a/arch/score/include/asm/uaccess.h +++ b/arch/score/include/asm/uaccess.h @@ -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. -- cgit v1.2.3