Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

uaccess: move VERIFY_{READ,WRITE} definitions to linux/uaccess.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro 5e6039d8 c1ae3cfa

+4 -89
-3
arch/alpha/include/asm/uaccess.h
··· 20 20 #define KERNEL_DS ((mm_segment_t) { 0UL }) 21 21 #define USER_DS ((mm_segment_t) { -0x40000000000UL }) 22 22 23 - #define VERIFY_READ 0 24 - #define VERIFY_WRITE 1 25 - 26 23 #define get_fs() (current_thread_info()->addr_limit) 27 24 #define get_ds() (KERNEL_DS) 28 25 #define set_fs(x) (current_thread_info()->addr_limit = (x))
-3
arch/arm/include/asm/uaccess.h
··· 26 26 #define __put_user_unaligned __put_user 27 27 #endif 28 28 29 - #define VERIFY_READ 0 30 - #define VERIFY_WRITE 1 31 - 32 29 /* 33 30 * The exception table consists of pairs of addresses: the first is the 34 31 * address of an instruction that is allowed to fault, and the second is
-3
arch/arm64/include/asm/uaccess.h
··· 36 36 #include <asm/memory.h> 37 37 #include <asm/compiler.h> 38 38 39 - #define VERIFY_READ 0 40 - #define VERIFY_WRITE 1 41 - 42 39 /* 43 40 * The exception table consists of pairs of relative offsets: the first 44 41 * is the relative offset to an instruction that is allowed to fault,
-3
arch/avr32/include/asm/uaccess.h
··· 11 11 #include <linux/errno.h> 12 12 #include <linux/sched.h> 13 13 14 - #define VERIFY_READ 0 15 - #define VERIFY_WRITE 1 16 - 17 14 typedef struct { 18 15 unsigned int is_user_space; 19 16 } mm_segment_t;
-3
arch/blackfin/include/asm/uaccess.h
··· 29 29 30 30 #define segment_eq(a, b) ((a) == (b)) 31 31 32 - #define VERIFY_READ 0 33 - #define VERIFY_WRITE 1 34 - 35 32 #define access_ok(type, addr, size) _access_ok((unsigned long)(addr), (size)) 36 33 37 34 /*
-3
arch/cris/include/asm/uaccess.h
··· 21 21 #include <asm/processor.h> 22 22 #include <asm/page.h> 23 23 24 - #define VERIFY_READ 0 25 - #define VERIFY_WRITE 1 26 - 27 24 /* 28 25 * The fs value determines whether argument validity checking should be 29 26 * performed or not. If get_fs() == USER_DS, checking is performed, with
-3
arch/frv/include/asm/uaccess.h
··· 22 22 23 23 #define __ptr(x) ((unsigned long __force *)(x)) 24 24 25 - #define VERIFY_READ 0 26 - #define VERIFY_WRITE 1 27 - 28 25 /* 29 26 * check that a range of addresses falls within the current address limit 30 27 */
-2
arch/hexagon/include/asm/uaccess.h
··· 50 50 * reasonably simple and not *too* slow. After all, we've got the 51 51 * MMU for backup. 52 52 */ 53 - #define VERIFY_READ 0 54 - #define VERIFY_WRITE 1 55 53 56 54 #define __access_ok(addr, size) \ 57 55 ((get_fs().seg == KERNEL_DS.seg) || \
-3
arch/ia64/include/asm/uaccess.h
··· 48 48 #define KERNEL_DS ((mm_segment_t) { ~0UL }) /* cf. access_ok() */ 49 49 #define USER_DS ((mm_segment_t) { TASK_SIZE-1 }) /* cf. access_ok() */ 50 50 51 - #define VERIFY_READ 0 52 - #define VERIFY_WRITE 1 53 - 54 51 #define get_ds() (KERNEL_DS) 55 52 #define get_fs() (current_thread_info()->addr_limit) 56 53 #define set_fs(x) (current_thread_info()->addr_limit = (x))
-3
arch/m32r/include/asm/uaccess.h
··· 16 16 #include <asm/page.h> 17 17 #include <asm/setup.h> 18 18 19 - #define VERIFY_READ 0 20 - #define VERIFY_WRITE 1 21 - 22 19 /* 23 20 * The fs value determines whether argument validity checking should be 24 21 * performed or not. If get_fs() == USER_DS, checking is performed, with
-3
arch/m68k/include/asm/uaccess_mm.h
··· 10 10 #include <linux/sched.h> 11 11 #include <asm/segment.h> 12 12 13 - #define VERIFY_READ 0 14 - #define VERIFY_WRITE 1 15 - 16 13 /* We let the MMU do all checking */ 17 14 static inline int access_ok(int type, const void __user *addr, 18 15 unsigned long size)
-3
arch/m68k/include/asm/uaccess_no.h
··· 10 10 11 11 #include <asm/segment.h> 12 12 13 - #define VERIFY_READ 0 14 - #define VERIFY_WRITE 1 15 - 16 13 #define access_ok(type,addr,size) _access_ok((unsigned long)(addr),(size)) 17 14 18 15 /*
-3
arch/metag/include/asm/uaccess.h
··· 6 6 */ 7 7 #include <linux/sched.h> 8 8 9 - #define VERIFY_READ 0 10 - #define VERIFY_WRITE 1 11 - 12 9 /* 13 10 * The fs value determines whether argument validity checking should be 14 11 * performed or not. If get_fs() == USER_DS, checking is performed, with
-3
arch/microblaze/include/asm/uaccess.h
··· 24 24 #include <asm/pgtable.h> 25 25 #include <linux/string.h> 26 26 27 - #define VERIFY_READ 0 28 - #define VERIFY_WRITE 1 29 - 30 27 /* 31 28 * On Microblaze the fs value is actually the top of the corresponding 32 29 * address space.
-3
arch/mips/include/asm/uaccess.h
··· 71 71 #define USER_DS ((mm_segment_t) { __UA_LIMIT }) 72 72 #endif 73 73 74 - #define VERIFY_READ 0 75 - #define VERIFY_WRITE 1 76 - 77 74 #define get_ds() (KERNEL_DS) 78 75 #define get_fs() (current_thread_info()->addr_limit) 79 76 #define set_fs(x) (current_thread_info()->addr_limit = (x))
-3
arch/mn10300/include/asm/uaccess.h
··· 19 19 #include <asm/page.h> 20 20 #include <asm/errno.h> 21 21 22 - #define VERIFY_READ 0 23 - #define VERIFY_WRITE 1 24 - 25 22 /* 26 23 * The fs value determines whether argument validity checking should be 27 24 * performed or not. If get_fs() == USER_DS, checking is performed, with
-3
arch/nios2/include/asm/uaccess.h
··· 19 19 20 20 #include <asm/page.h> 21 21 22 - #define VERIFY_READ 0 23 - #define VERIFY_WRITE 1 24 - 25 22 /* 26 23 * The exception table consists of pairs of addresses: the first is the 27 24 * address of an instruction that is allowed to fault, and the second is
-3
arch/openrisc/include/asm/uaccess.h
··· 28 28 #include <linux/string.h> 29 29 #include <asm/page.h> 30 30 31 - #define VERIFY_READ 0 32 - #define VERIFY_WRITE 1 33 - 34 31 /* 35 32 * The fs value determines whether argument validity checking should be 36 33 * performed or not. If get_fs() == USER_DS, checking is performed, with
-3
arch/parisc/include/asm/uaccess.h
··· 13 13 #include <linux/string.h> 14 14 #include <linux/thread_info.h> 15 15 16 - #define VERIFY_READ 0 17 - #define VERIFY_WRITE 1 18 - 19 16 #define KERNEL_DS ((mm_segment_t){0}) 20 17 #define USER_DS ((mm_segment_t){1}) 21 18
-3
arch/powerpc/include/asm/uaccess.h
··· 11 11 #include <asm/processor.h> 12 12 #include <asm/page.h> 13 13 14 - #define VERIFY_READ 0 15 - #define VERIFY_WRITE 1 16 - 17 14 /* 18 15 * The fs value determines whether argument validity checking should be 19 16 * performed or not. If get_fs() == USER_DS, checking is performed, with
-3
arch/s390/include/asm/uaccess.h
··· 17 17 #include <asm/processor.h> 18 18 #include <asm/ctl_reg.h> 19 19 20 - #define VERIFY_READ 0 21 - #define VERIFY_WRITE 1 22 - 23 20 24 21 /* 25 22 * The fs value determines whether argument validity checking should be
-3
arch/score/include/asm/uaccess.h
··· 6 6 #include <linux/thread_info.h> 7 7 #include <asm/extable.h> 8 8 9 - #define VERIFY_READ 0 10 - #define VERIFY_WRITE 1 11 - 12 9 #define get_ds() (KERNEL_DS) 13 10 #define get_fs() (current_thread_info()->addr_limit) 14 11 #define segment_eq(a, b) ((a).seg == (b).seg)
-3
arch/sh/include/asm/uaccess.h
··· 5 5 #include <linux/sched.h> 6 6 #include <asm/segment.h> 7 7 8 - #define VERIFY_READ 0 9 - #define VERIFY_WRITE 1 10 - 11 8 #define __addr_ok(addr) \ 12 9 ((unsigned long __force)(addr) < current_thread_info()->addr_limit.seg) 13 10
-3
arch/sparc/include/asm/uaccess_32.h
··· 30 30 #define KERNEL_DS ((mm_segment_t) { 0 }) 31 31 #define USER_DS ((mm_segment_t) { -1 }) 32 32 33 - #define VERIFY_READ 0 34 - #define VERIFY_WRITE 1 35 - 36 33 #define get_ds() (KERNEL_DS) 37 34 #define get_fs() (current->thread.current_ds) 38 35 #define set_fs(val) ((current->thread.current_ds) = (val))
-3
arch/sparc/include/asm/uaccess_64.h
··· 36 36 #define KERNEL_DS ((mm_segment_t) { ASI_P }) 37 37 #define USER_DS ((mm_segment_t) { ASI_AIUS }) /* har har har */ 38 38 39 - #define VERIFY_READ 0 40 - #define VERIFY_WRITE 1 41 - 42 39 #define get_fs() ((mm_segment_t){(current_thread_info()->current_ds)}) 43 40 #define get_ds() (KERNEL_DS) 44 41
-3
arch/tile/include/asm/uaccess.h
··· 24 24 #include <asm/processor.h> 25 25 #include <asm/page.h> 26 26 27 - #define VERIFY_READ 0 28 - #define VERIFY_WRITE 1 29 - 30 27 /* 31 28 * The fs value determines whether argument validity checking should be 32 29 * performed or not. If get_fs() == USER_DS, checking is performed, with
-3
arch/x86/include/asm/uaccess.h
··· 13 13 #include <asm/smap.h> 14 14 #include <asm/extable.h> 15 15 16 - #define VERIFY_READ 0 17 - #define VERIFY_WRITE 1 18 - 19 16 /* 20 17 * The fs value determines whether argument validity checking should be 21 18 * performed or not. If get_fs() == USER_DS, checking is performed, with
-3
arch/xtensa/include/asm/asm-uaccess.h
··· 19 19 #include <linux/errno.h> 20 20 #include <asm/types.h> 21 21 22 - #define VERIFY_READ 0 23 - #define VERIFY_WRITE 1 24 - 25 22 #include <asm/current.h> 26 23 #include <asm/asm-offsets.h> 27 24 #include <asm/processor.h>
-3
arch/xtensa/include/asm/uaccess.h
··· 20 20 #include <linux/prefetch.h> 21 21 #include <asm/types.h> 22 22 23 - #define VERIFY_READ 0 24 - #define VERIFY_WRITE 1 25 - 26 23 #include <linux/sched.h> 27 24 28 25 /*
-3
include/asm-generic/uaccess.h
··· 35 35 #define segment_eq(a, b) ((a).seg == (b).seg) 36 36 #endif 37 37 38 - #define VERIFY_READ 0 39 - #define VERIFY_WRITE 1 40 - 41 38 #define access_ok(type, addr, size) __access_ok((unsigned long)(addr),(size)) 42 39 43 40 /*
+4
include/linux/uaccess.h
··· 2 2 #define __LINUX_UACCESS_H__ 3 3 4 4 #include <linux/sched.h> 5 + 6 + #define VERIFY_READ 0 7 + #define VERIFY_WRITE 1 8 + 5 9 #include <asm/uaccess.h> 6 10 7 11 static __always_inline void pagefault_disabled_inc(void)