]> git.hungrycats.org Git - linux/commitdiff
[PATCH] ARM initial annotations
authorAlexander Viro <viro@www.linux.org.uk>
Fri, 30 Jul 2004 15:48:39 +0000 (08:48 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Fri, 30 Jul 2004 15:48:39 +0000 (08:48 -0700)
Usual set of initial annotations for a platform.

Signed-off-by: Al Viro <viro@parcelfarce.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/arm/Makefile
arch/arm/kernel/apm.c
arch/arm/kernel/ptrace.c
arch/arm/kernel/signal.c
arch/arm/kernel/sys_arm.c
arch/arm/kernel/traps.c
arch/arm/mm/fault.c
arch/arm/mm/init.c
include/asm-arm/ipc.h
include/asm-arm/signal.h
include/asm-arm/uaccess.h

index aeafdd7a05668989aa741b4dd0bb9910321b9b0b..613bb1b0ac1f808ad29d2f6797f4fb7480ff9395 100644 (file)
@@ -58,6 +58,8 @@ tune-$(CONFIG_CPU_V6)         :=-mtune=strongarm
 CFLAGS         +=-mapcs-32 $(arch-y) $(tune-y) -mshort-load-bytes -msoft-float -Wa,-mno-fpu -Uarm
 AFLAGS         +=-mapcs-32 $(arch-y) $(tune-y) -msoft-float -Wa,-mno-fpu
 
+CHECK          := $(CHECK) -D__arm__=1
+
 #Default value
 DATAADDR       := .
 
index 7849b28fcdc8431232da445a3535bda75bae5549..a64f78defdd4cd91e2952c1fa8b162e26307077e 100644 (file)
@@ -206,7 +206,7 @@ static int apm_suspend(void)
        return err;
 }
 
-static ssize_t apm_read(struct file *fp, char *buf, size_t count, loff_t *ppos)
+static ssize_t apm_read(struct file *fp, char __user *buf, size_t count, loff_t *ppos)
 {
        struct apm_user *as = fp->private_data;
        apm_event_t event;
index fd3d5b2bad26d4ef2f9d97cbeeea0c97bb2776e3..d4195fd5b889276c7f125f4012fe4b747ee8adf6 100644 (file)
@@ -485,7 +485,7 @@ void ptrace_break(struct task_struct *tsk, struct pt_regs *regs)
        info.si_signo = SIGTRAP;
        info.si_errno = 0;
        info.si_code  = TRAP_BRKPT;
-       info.si_addr  = (void *)instruction_pointer(regs);
+       info.si_addr  = (void __user *)instruction_pointer(regs);
 
        force_sig_info(SIGTRAP, &info, tsk);
 }
index 4aef80895dedb148a1a28b4ba7c2552ea0d98d08..d214e8d494f60354b1fe9571c4decbafc2da38f1 100644 (file)
@@ -419,7 +419,7 @@ setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info,
        __put_user_error(NULL, &frame->uc.uc_link, err);
 
        memset(&stack, 0, sizeof(stack));
-       stack.ss_sp = (void *)current->sas_ss_sp;
+       stack.ss_sp = (void __user *)current->sas_ss_sp;
        stack.ss_flags = sas_ss_flags(regs->ARM_sp);
        stack.ss_size = current->sas_ss_size;
        err |= __copy_to_user(&frame->uc.uc_stack, &stack, sizeof(stack));
index 79acdd17f1aafec159e4e5425e858910c0726693..fb26b3bf96b1c6019d46509dbaa598dff27f9ac3 100644 (file)
@@ -178,7 +178,7 @@ asmlinkage int sys_ipc(uint call, int first, int second, int third,
                union semun fourth;
                if (!ptr)
                        return -EINVAL;
-               if (get_user(fourth.__pad, (void __user **) ptr))
+               if (get_user(fourth.__pad, (void __user * __user *) ptr))
                        return -EFAULT;
                return sys_semctl (first, second, third, fourth);
        }
index 5b21d20235017ab6c757185f3da84110f0170991..e5c7f285bfaf1f8594e3b67bc62bd8a812c11c83 100644 (file)
@@ -263,7 +263,7 @@ asmlinkage void do_undefinstr(struct pt_regs *regs)
        unsigned int instr;
        struct undef_hook *hook;
        siginfo_t info;
-       void *pc;
+       void __user *pc;
 
        /*
         * According to the ARM ARM, PC is 2 or 4 bytes ahead,
@@ -272,11 +272,11 @@ asmlinkage void do_undefinstr(struct pt_regs *regs)
         */
        regs->ARM_pc -= correction;
 
-       pc = (void *)instruction_pointer(regs);
+       pc = (void __user *)instruction_pointer(regs);
        if (thumb_mode(regs)) {
-               get_user(instr, (u16 *)pc);
+               get_user(instr, (u16 __user *)pc);
        } else {
-               get_user(instr, (u32 *)pc);
+               get_user(instr, (u32 __user *)pc);
        }
 
        spin_lock_irq(&undef_lock);
@@ -368,7 +368,7 @@ static int bad_syscall(int n, struct pt_regs *regs)
        info.si_signo = SIGILL;
        info.si_errno = 0;
        info.si_code  = ILL_ILLTRP;
-       info.si_addr  = (void *)instruction_pointer(regs) -
+       info.si_addr  = (void __user *)instruction_pointer(regs) -
                         (thumb_mode(regs) ? 2 : 4);
 
        force_sig_info(SIGILL, &info, current);
@@ -481,7 +481,7 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
        info.si_signo = SIGILL;
        info.si_errno = 0;
        info.si_code  = ILL_ILLTRP;
-       info.si_addr  = (void *)instruction_pointer(regs) -
+       info.si_addr  = (void __user *)instruction_pointer(regs) -
                         (thumb_mode(regs) ? 2 : 4);
 
        force_sig_info(SIGILL, &info, current);
@@ -519,7 +519,7 @@ baddataabort(int code, unsigned long instr, struct pt_regs *regs)
        info.si_signo = SIGILL;
        info.si_errno = 0;
        info.si_code  = ILL_ILLOPC;
-       info.si_addr  = (void *)addr;
+       info.si_addr  = (void __user *)addr;
 
        force_sig_info(SIGILL, &info, current);
        die_if_kernel("unknown data abort code", regs, instr);
index c0006176912362f2ab56f546936f157dad5b07aa..a38a1ffecbeed34008a9804b72a5d348e9091dd9 100644 (file)
@@ -129,7 +129,7 @@ __do_user_fault(struct task_struct *tsk, unsigned long addr,
        si.si_signo = SIGSEGV;
        si.si_errno = 0;
        si.si_code = code;
-       si.si_addr = (void *)addr;
+       si.si_addr = (void __user *)addr;
        force_sig_info(SIGSEGV, &si, tsk);
 }
 
index c183e6537114be0dcb7d92c365cffcacd182b2a0..db6ebc23672778de13c9ecc363f792336eeddfab 100644 (file)
@@ -502,7 +502,7 @@ void __init paging_init(struct meminfo *mi, struct machine_desc *mdesc)
                 */
                arch_adjust_zones(node, zone_size, zhole_size);
 
-               free_area_init_node(node, pgdat, 0, zone_size,
+               free_area_init_node(node, pgdat, NULL, zone_size,
                                bdata->node_boot_start >> PAGE_SHIFT, zhole_size);
        }
 
index c330504ba3f4c13530b32544aff93c0d628c43dc..affae4b95f973962aa17276d57a1d970bf47e1ee 100644 (file)
@@ -7,7 +7,7 @@
  * See arch/arm/kernel/sys-arm.c for ugly details..
  */
 struct ipc_kludge {
-       struct msgbuf *msgp;
+       struct msgbuf __user *msgp;
        long msgtyp;
 };
 
index 6d623e24c0fbd3149b649376589bb2acaf44bf94..b033e5fd60fa93c1c6f9116911ea36213158add9 100644 (file)
@@ -133,7 +133,11 @@ typedef unsigned long sigset_t;
 #define SIG_SETMASK        2   /* for setting the signal mask */
 
 /* Type of a signal handler.  */
-typedef void (*__sighandler_t)(int);
+typedef void __signalfn_t(int);
+typedef __signalfn_t __user *__sighandler_t;
+
+typedef void __restorefn_t(void);
+typedef __restorefn_t __user *__sigrestore_t;
 
 #define SIG_DFL        ((__sighandler_t)0)     /* default signal handling */
 #define SIG_IGN        ((__sighandler_t)1)     /* ignore signal */
@@ -144,13 +148,13 @@ struct old_sigaction {
        __sighandler_t sa_handler;
        old_sigset_t sa_mask;
        unsigned long sa_flags;
-       void (*sa_restorer)(void);
+       __sigrestore_t sa_restorer;
 };
 
 struct sigaction {
        __sighandler_t sa_handler;
        unsigned long sa_flags;
-       void (*sa_restorer)(void);
+       __sigrestore_t sa_restorer;
        sigset_t sa_mask;               /* mask last for extensibility */
 };
 
@@ -177,7 +181,7 @@ struct sigaction {
 #endif /* __KERNEL__ */
 
 typedef struct sigaltstack {
-       void *ss_sp;
+       void __user *ss_sp;
        int ss_flags;
        size_t ss_size;
 } stack_t;
index d01310569c470385efc227fb4d3a275898856601..51bc2a968dbfc60e8584d8693a3f3407a7caf331 100644 (file)
@@ -68,6 +68,7 @@ static inline void set_fs (mm_segment_t fs)
 /* We use 33-bit arithmetic here... */
 #define __range_ok(addr,size) ({ \
        unsigned long flag, sum; \
+       __chk_user_ptr(addr);   \
        __asm__("adds %1, %2, %3; sbcccs %1, %1, %0; movcc %0, #0" \
                : "=&r" (flag), "=&r" (sum) \
                : "r" (addr), "Ir" (size), "0" (current_thread_info()->addr_limit) \
@@ -117,7 +118,7 @@ extern int __get_user_bad(void);
 
 #define get_user(x,p)                                                  \
        ({                                                              \
-               const register typeof(*(p)) *__p asm("r0") = (p);       \
+               const register typeof(*(p)) __user *__p asm("r0") = (p);\
                register typeof(*(p)) __r1 asm("r1");                   \
                register int __e asm("r0");                             \
                switch (sizeof(*(__p))) {                               \
@@ -156,6 +157,7 @@ extern int __get_user_bad(void);
 do {                                                                   \
        unsigned long __gu_addr = (unsigned long)(ptr);                 \
        unsigned long __gu_val;                                         \
+       __chk_user_ptr(ptr);                                            \
        switch (sizeof(*(ptr))) {                                       \
        case 1: __get_user_asm_byte(__gu_val,__gu_addr,err);    break;  \
        case 2: __get_user_asm_half(__gu_val,__gu_addr,err);    break;  \
@@ -236,7 +238,7 @@ extern int __put_user_bad(void);
 #define put_user(x,p)                                                  \
        ({                                                              \
                const register typeof(*(p)) __r1 asm("r1") = (x);       \
-               const register typeof(*(p)) *__p asm("r0") = (p);       \
+               const register typeof(*(p)) __user *__p asm("r0") = (p);\
                register int __e asm("r0");                             \
                switch (sizeof(*(__p))) {                               \
                case 1:                                                 \
@@ -273,6 +275,7 @@ extern int __put_user_bad(void);
 do {                                                                   \
        unsigned long __pu_addr = (unsigned long)(ptr);                 \
        __typeof__(*(ptr)) __pu_val = (x);                              \
+       __chk_user_ptr(ptr);                                            \
        switch (sizeof(*(ptr))) {                                       \
        case 1: __put_user_asm_byte(__pu_val,__pu_addr,err);    break;  \
        case 2: __put_user_asm_half(__pu_val,__pu_addr,err);    break;  \