Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e08f457c authored by Paul Mundt's avatar Paul Mundt Committed by Paul Mundt
Browse files

sh: __user annotations for __get/__put_user().



This adds in some more __user annotations. These weren't being
handled properly in some of the __get_user and __put_user paths,
so tidy those up.

Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent 7a302a96
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
#include <linux/kexec.h>
#include <linux/kdebug.h>
#include <linux/tick.h>
#include <linux/reboot.h>
#include <asm/uaccess.h>
#include <asm/mmu_context.h>
#include <asm/pgalloc.h>
@@ -449,23 +450,20 @@ asmlinkage int sys_vfork(unsigned long r4, unsigned long r5,
/*
 * sys_execve() executes a new program.
 */
asmlinkage int sys_execve(char *ufilename, char **uargv,
			  char **uenvp, unsigned long r7,
asmlinkage int sys_execve(char __user *ufilename, char __user * __user *uargv,
			  char __user * __user *uenvp, unsigned long r7,
			  struct pt_regs __regs)
{
	struct pt_regs *regs = RELOC_HIDE(&__regs, 0);
	int error;
	char *filename;

	filename = getname((char __user *)ufilename);
	filename = getname(ufilename);
	error = PTR_ERR(filename);
	if (IS_ERR(filename))
		goto out;

	error = do_execve(filename,
			  (char __user * __user *)uargv,
			  (char __user * __user *)uenvp,
			  regs);
	error = do_execve(filename, uargv, uenvp, regs);
	if (error == 0) {
		task_lock(current);
		current->ptrace &= ~PT_DTRACE;
+4 −4
Original line number Diff line number Diff line
@@ -99,7 +99,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
		ret = -EIO;
		if (copied != sizeof(tmp))
			break;
		ret = put_user(tmp,(unsigned long *) data);
		ret = put_user(tmp,(unsigned long __user *) data);
		break;
	}

@@ -128,7 +128,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
			tmp = !!tsk_used_math(child);
		else
			tmp = 0;
		ret = put_user(tmp, (unsigned long *)data);
		ret = put_user(tmp, (unsigned long __user *)data);
		break;
	}

@@ -196,7 +196,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)

	case PTRACE_SINGLESTEP: {  /* set the trap flag. */
		long pc;
		struct pt_regs *dummy = NULL;
		struct pt_regs *regs = NULL;

		ret = -EIO;
		if (!valid_signal(data))
@@ -207,7 +207,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
			child->ptrace |= PT_DTRACE;
		}

		pc = get_stack_long(child, (long)&dummy->pc);
		pc = get_stack_long(child, (long)&regs->pc);

		/* Next scheduling will set up UBC */
		if (child->thread.ubc_pc == 0)
+2 −2
Original line number Diff line number Diff line
@@ -261,7 +261,7 @@ asmlinkage int sys_rt_sigreturn(unsigned long r4, unsigned long r5,
		goto badframe;
	/* It is more difficult to avoid calling this function than to
	   call it and ignore errors.  */
	do_sigaltstack(&st, NULL, regs->regs[15]);
	do_sigaltstack((const stack_t __user *)&st, NULL, (unsigned long)frame);

	return r0;

+1 −1
Original line number Diff line number Diff line
@@ -581,7 +581,7 @@ asmlinkage void do_address_error(struct pt_regs *regs,
		info.si_signo = SIGBUS;
		info.si_errno = 0;
		info.si_code = si_code;
		info.si_addr = (void *) address;
		info.si_addr = (void __user *)address;
		force_sig_info(SIGBUS, &info, current);
	} else {
		if (regs->pc & 1)
+1 −0
Original line number Diff line number Diff line
@@ -60,6 +60,7 @@ extern void (*copy_page)(void *to, void *from);

extern unsigned long shm_align_mask;
extern unsigned long max_low_pfn, min_low_pfn;
extern unsigned long memory_start, memory_end;

#ifdef CONFIG_MMU
extern void clear_page_slow(void *to);
Loading