Commit 720cc7e3 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] sparse alpha: trivial parts of __user annotation

Trivial stuff in arch/alpha annotated; in two cases of
osf_proplist_syscall() dereferencing userland pointers replaced with
get_user
parent 2d6ef4c5
This diff is collapsed.
...@@ -239,8 +239,9 @@ release_thread(struct task_struct *dead_task) ...@@ -239,8 +239,9 @@ release_thread(struct task_struct *dead_task)
* with parameters (SIGCHLD, 0). * with parameters (SIGCHLD, 0).
*/ */
int int
alpha_clone(unsigned long clone_flags, unsigned long usp, int *parent_tid, alpha_clone(unsigned long clone_flags, unsigned long usp,
int *child_tid, unsigned long tls_value, struct pt_regs *regs) int __user *parent_tid, int __user *child_tid,
unsigned long tls_value, struct pt_regs *regs)
{ {
if (!usp) if (!usp)
usp = rdusp(); usp = rdusp();
...@@ -464,7 +465,8 @@ dump_elf_task_fp(elf_fpreg_t *dest, struct task_struct *task) ...@@ -464,7 +465,8 @@ dump_elf_task_fp(elf_fpreg_t *dest, struct task_struct *task)
* Don't do this at home. * Don't do this at home.
*/ */
asmlinkage int asmlinkage int
sys_execve(char *ufilename, char **argv, char **envp, sys_execve(char __user *ufilename, char __user * __user *argv,
char __user * __user *envp,
unsigned long a3, unsigned long a4, unsigned long a5, unsigned long a3, unsigned long a4, unsigned long a5,
struct pt_regs regs) struct pt_regs regs)
{ {
......
...@@ -84,8 +84,8 @@ osf_sigprocmask(int how, unsigned long newmask, long a2, long a3, ...@@ -84,8 +84,8 @@ osf_sigprocmask(int how, unsigned long newmask, long a2, long a3,
} }
asmlinkage int asmlinkage int
osf_sigaction(int sig, const struct osf_sigaction *act, osf_sigaction(int sig, const struct osf_sigaction __user *act,
struct osf_sigaction *oact) struct osf_sigaction __user *oact)
{ {
struct k_sigaction new_ka, old_ka; struct k_sigaction new_ka, old_ka;
int ret; int ret;
...@@ -115,8 +115,9 @@ osf_sigaction(int sig, const struct osf_sigaction *act, ...@@ -115,8 +115,9 @@ osf_sigaction(int sig, const struct osf_sigaction *act,
} }
asmlinkage long asmlinkage long
sys_rt_sigaction(int sig, const struct sigaction *act, struct sigaction *oact, sys_rt_sigaction(int sig, const struct sigaction __user *act,
size_t sigsetsize, void *restorer) struct sigaction __user *oact,
size_t sigsetsize, void __user *restorer)
{ {
struct k_sigaction new_ka, old_ka; struct k_sigaction new_ka, old_ka;
int ret; int ret;
...@@ -165,7 +166,7 @@ do_sigsuspend(old_sigset_t mask, struct pt_regs *reg, struct switch_stack *sw) ...@@ -165,7 +166,7 @@ do_sigsuspend(old_sigset_t mask, struct pt_regs *reg, struct switch_stack *sw)
} }
asmlinkage int asmlinkage int
do_rt_sigsuspend(sigset_t *uset, size_t sigsetsize, do_rt_sigsuspend(sigset_t __user *uset, size_t sigsetsize,
struct pt_regs *reg, struct switch_stack *sw) struct pt_regs *reg, struct switch_stack *sw)
{ {
sigset_t oldset, set; sigset_t oldset, set;
...@@ -192,7 +193,7 @@ do_rt_sigsuspend(sigset_t *uset, size_t sigsetsize, ...@@ -192,7 +193,7 @@ do_rt_sigsuspend(sigset_t *uset, size_t sigsetsize,
} }
asmlinkage int asmlinkage int
sys_sigaltstack(const stack_t *uss, stack_t *uoss) sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss)
{ {
return do_sigaltstack(uss, uoss, rdusp()); return do_sigaltstack(uss, uoss, rdusp());
} }
...@@ -223,7 +224,7 @@ struct rt_sigframe ...@@ -223,7 +224,7 @@ struct rt_sigframe
#define INSN_CALLSYS 0x00000083 #define INSN_CALLSYS 0x00000083
static long static long
restore_sigcontext(struct sigcontext *sc, struct pt_regs *regs, restore_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
struct switch_stack *sw) struct switch_stack *sw)
{ {
unsigned long usp; unsigned long usp;
...@@ -276,7 +277,7 @@ restore_sigcontext(struct sigcontext *sc, struct pt_regs *regs, ...@@ -276,7 +277,7 @@ restore_sigcontext(struct sigcontext *sc, struct pt_regs *regs,
registers and transfer control from userland. */ registers and transfer control from userland. */
asmlinkage void asmlinkage void
do_sigreturn(struct sigcontext *sc, struct pt_regs *regs, do_sigreturn(struct sigcontext __user *sc, struct pt_regs *regs,
struct switch_stack *sw) struct switch_stack *sw)
{ {
sigset_t set; sigset_t set;
...@@ -314,7 +315,7 @@ do_sigreturn(struct sigcontext *sc, struct pt_regs *regs, ...@@ -314,7 +315,7 @@ do_sigreturn(struct sigcontext *sc, struct pt_regs *regs,
} }
asmlinkage void asmlinkage void
do_rt_sigreturn(struct rt_sigframe *frame, struct pt_regs *regs, do_rt_sigreturn(struct rt_sigframe __user *frame, struct pt_regs *regs,
struct switch_stack *sw) struct switch_stack *sw)
{ {
sigset_t set; sigset_t set;
...@@ -356,17 +357,17 @@ do_rt_sigreturn(struct rt_sigframe *frame, struct pt_regs *regs, ...@@ -356,17 +357,17 @@ do_rt_sigreturn(struct rt_sigframe *frame, struct pt_regs *regs,
* Set up a signal frame. * Set up a signal frame.
*/ */
static inline void * static inline void __user *
get_sigframe(struct k_sigaction *ka, unsigned long sp, size_t frame_size) get_sigframe(struct k_sigaction *ka, unsigned long sp, size_t frame_size)
{ {
if ((ka->sa.sa_flags & SA_ONSTACK) != 0 && ! on_sig_stack(sp)) if ((ka->sa.sa_flags & SA_ONSTACK) != 0 && ! on_sig_stack(sp))
sp = current->sas_ss_sp + current->sas_ss_size; sp = current->sas_ss_sp + current->sas_ss_size;
return (void *)((sp - frame_size) & -32ul); return (void __user *)((sp - frame_size) & -32ul);
} }
static long static long
setup_sigcontext(struct sigcontext *sc, struct pt_regs *regs, setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
struct switch_stack *sw, unsigned long mask, unsigned long sp) struct switch_stack *sw, unsigned long mask, unsigned long sp)
{ {
long i, err = 0; long i, err = 0;
...@@ -426,7 +427,7 @@ setup_frame(int sig, struct k_sigaction *ka, sigset_t *set, ...@@ -426,7 +427,7 @@ setup_frame(int sig, struct k_sigaction *ka, sigset_t *set,
struct pt_regs *regs, struct switch_stack * sw) struct pt_regs *regs, struct switch_stack * sw)
{ {
unsigned long oldsp, r26, err = 0; unsigned long oldsp, r26, err = 0;
struct sigframe *frame; struct sigframe __user *frame;
oldsp = rdusp(); oldsp = rdusp();
frame = get_sigframe(ka, oldsp, sizeof(*frame)); frame = get_sigframe(ka, oldsp, sizeof(*frame));
...@@ -479,7 +480,7 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, ...@@ -479,7 +480,7 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
sigset_t *set, struct pt_regs *regs, struct switch_stack * sw) sigset_t *set, struct pt_regs *regs, struct switch_stack * sw)
{ {
unsigned long oldsp, r26, err = 0; unsigned long oldsp, r26, err = 0;
struct rt_sigframe *frame; struct rt_sigframe __user *frame;
oldsp = rdusp(); oldsp = rdusp();
frame = get_sigframe(ka, oldsp, sizeof(*frame)); frame = get_sigframe(ka, oldsp, sizeof(*frame));
......
...@@ -106,7 +106,7 @@ alpha_fp_emul (unsigned long pc) ...@@ -106,7 +106,7 @@ alpha_fp_emul (unsigned long pc)
__u32 insn; __u32 insn;
long si_code; long si_code;
get_user(insn, (__u32*)pc); get_user(insn, (__u32 __user *)pc);
fc = (insn >> 0) & 0x1f; /* destination register */ fc = (insn >> 0) & 0x1f; /* destination register */
fb = (insn >> 16) & 0x1f; fb = (insn >> 16) & 0x1f;
fa = (insn >> 21) & 0x1f; fa = (insn >> 21) & 0x1f;
...@@ -351,7 +351,7 @@ alpha_fp_emul_imprecise (struct pt_regs *regs, unsigned long write_mask) ...@@ -351,7 +351,7 @@ alpha_fp_emul_imprecise (struct pt_regs *regs, unsigned long write_mask)
* up to the first occurrence of such an instruction. * up to the first occurrence of such an instruction.
*/ */
while (write_mask) { while (write_mask) {
get_user(insn, (__u32*)(trigger_pc)); get_user(insn, (__u32 __user *)(trigger_pc));
opcode = insn >> 26; opcode = insn >> 26;
rc = insn & 0x1f; rc = insn & 0x1f;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment