Commit 6e9acb58 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

LSM: change if statements into something more readable for the arch/* files.

parent 62561c77
...@@ -711,7 +711,8 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) ...@@ -711,7 +711,8 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
/* are we already being traced? */ /* are we already being traced? */
if (current->ptrace & PT_PTRACED) if (current->ptrace & PT_PTRACED)
goto out; goto out;
if ((ret = security_ptrace(current->parent, current))) ret = security_ptrace(current->parent, current);
if (ret)
goto out; goto out;
/* set the ptrace bit in the process flags. */ /* set the ptrace bit in the process flags. */
current->ptrace |= PT_PTRACED; current->ptrace |= PT_PTRACED;
......
...@@ -160,7 +160,8 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) ...@@ -160,7 +160,8 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
/* are we already being traced? */ /* are we already being traced? */
if (current->ptrace & PT_PTRACED) if (current->ptrace & PT_PTRACED)
goto out; goto out;
if ((ret = security_ptrace(current->parent, current))) ret = security_ptrace(current->parent, current);
if (ret)
goto out; goto out;
/* set the ptrace bit in the process flags. */ /* set the ptrace bit in the process flags. */
current->ptrace |= PT_PTRACED; current->ptrace |= PT_PTRACED;
......
...@@ -1101,7 +1101,8 @@ sys_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data, ...@@ -1101,7 +1101,8 @@ sys_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data,
/* are we already being traced? */ /* are we already being traced? */
if (current->ptrace & PT_PTRACED) if (current->ptrace & PT_PTRACED)
goto out; goto out;
if ((ret = security_ptrace(current->parent, current))) ret = security_ptrace(current->parent, current);
if (ret)
goto out; goto out;
current->ptrace |= PT_PTRACED; current->ptrace |= PT_PTRACED;
ret = 0; ret = 0;
......
...@@ -166,7 +166,8 @@ int sys_ptrace(long request, long pid, long addr, long data) ...@@ -166,7 +166,8 @@ int sys_ptrace(long request, long pid, long addr, long data)
/* are we already being traced? */ /* are we already being traced? */
if (current->ptrace & PT_PTRACED) if (current->ptrace & PT_PTRACED)
goto out; goto out;
if ((ret = security_ptrace(current->parent, current))) ret = security_ptrace(current->parent, current);
if (ret)
goto out; goto out;
/* set the ptrace bit in the process flags. */ /* set the ptrace bit in the process flags. */
current->ptrace |= PT_PTRACED; current->ptrace |= PT_PTRACED;
......
...@@ -59,7 +59,8 @@ int sys_ptrace(long request, long pid, long addr, long data) ...@@ -59,7 +59,8 @@ int sys_ptrace(long request, long pid, long addr, long data)
/* are we already being traced? */ /* are we already being traced? */
if (current->ptrace & PT_PTRACED) if (current->ptrace & PT_PTRACED)
goto out; goto out;
if ((ret = security_ptrace(current->parent, current))) ret = security_ptrace(current->parent, current);
if (ret)
goto out; goto out;
/* set the ptrace bit in the process flags. */ /* set the ptrace bit in the process flags. */
current->ptrace |= PT_PTRACED; current->ptrace |= PT_PTRACED;
......
...@@ -48,7 +48,8 @@ int sys32_ptrace(long request, long pid, unsigned long addr, unsigned long data) ...@@ -48,7 +48,8 @@ int sys32_ptrace(long request, long pid, unsigned long addr, unsigned long data)
/* are we already being traced? */ /* are we already being traced? */
if (current->ptrace & PT_PTRACED) if (current->ptrace & PT_PTRACED)
goto out; goto out;
if ((ret = security_ptrace(current->parent, current))) ret = security_ptrace(current->parent, current);
if (ret)
goto out; goto out;
/* set the ptrace bit in the process flags. */ /* set the ptrace bit in the process flags. */
current->ptrace |= PT_PTRACED; current->ptrace |= PT_PTRACED;
......
...@@ -3521,7 +3521,8 @@ static int do_execve32(char * filename, u32 * argv, u32 * envp, struct pt_regs * ...@@ -3521,7 +3521,8 @@ static int do_execve32(char * filename, u32 * argv, u32 * envp, struct pt_regs *
if ((retval = bprm.envc) < 0) if ((retval = bprm.envc) < 0)
goto out_mm; goto out_mm;
if ((retval = security_bprm_alloc(&bprm))) retval = security_bprm_alloc(&bprm);
if (retval)
goto out; goto out;
retval = prepare_binprm(&bprm); retval = prepare_binprm(&bprm);
......
...@@ -323,7 +323,8 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) ...@@ -323,7 +323,8 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
ret = -EPERM; ret = -EPERM;
if (current->ptrace & PT_PTRACED) if (current->ptrace & PT_PTRACED)
goto out; goto out;
if ((ret = security_ptrace(current->parent, current))) ret = security_ptrace(current->parent, current);
if (ret)
goto out; goto out;
/* set the ptrace bit in the process flags. */ /* set the ptrace bit in the process flags. */
current->ptrace |= PT_PTRACED; current->ptrace |= PT_PTRACED;
......
...@@ -563,7 +563,8 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) ...@@ -563,7 +563,8 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
ret = -EPERM; ret = -EPERM;
if (current->ptrace & PT_PTRACED) if (current->ptrace & PT_PTRACED)
goto out; goto out;
if ((ret = security_ptrace(current->parent, current))) ret = security_ptrace(current->parent, current);
if (ret)
goto out; goto out;
/* set the ptrace bit in the process flags. */ /* set the ptrace bit in the process flags. */
current->ptrace |= PT_PTRACED; current->ptrace |= PT_PTRACED;
......
...@@ -291,7 +291,8 @@ asmlinkage void do_ptrace(struct pt_regs *regs) ...@@ -291,7 +291,8 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
pt_error_return(regs, EPERM); pt_error_return(regs, EPERM);
goto out; goto out;
} }
if ((ret = security_ptrace(current->parent, current))) { ret = security_ptrace(current->parent, current);
if (ret) {
pt_error_return(regs, -ret); pt_error_return(regs, -ret);
goto out; goto out;
} }
......
...@@ -140,7 +140,8 @@ asmlinkage void do_ptrace(struct pt_regs *regs) ...@@ -140,7 +140,8 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
pt_error_return(regs, EPERM); pt_error_return(regs, EPERM);
goto out; goto out;
} }
if ((ret = security_ptrace(current->parent, current))) { ret = security_ptrace(current->parent, current);
if (ret) {
pt_error_return(regs, -ret); pt_error_return(regs, -ret);
goto out; goto out;
} }
......
...@@ -3026,7 +3026,8 @@ do_execve32(char * filename, u32 * argv, u32 * envp, struct pt_regs * regs) ...@@ -3026,7 +3026,8 @@ do_execve32(char * filename, u32 * argv, u32 * envp, struct pt_regs * regs)
if ((retval = bprm.envc) < 0) if ((retval = bprm.envc) < 0)
goto out_mm; goto out_mm;
if ((retval = security_bprm_alloc(&bprm))) retval = security_bprm_alloc(&bprm);
if (retval)
goto out; goto out;
retval = prepare_binprm(&bprm); retval = prepare_binprm(&bprm);
......
...@@ -33,7 +33,8 @@ int sys_ptrace(long request, long pid, long addr, long data) ...@@ -33,7 +33,8 @@ int sys_ptrace(long request, long pid, long addr, long data)
if (current->ptrace & PT_PTRACED) if (current->ptrace & PT_PTRACED)
goto out; goto out;
if ((ret = security_ptrace(current->parent, current))) ret = security_ptrace(current->parent, current);
if (ret)
goto out; goto out;
/* set the ptrace bit in the process flags. */ /* set the ptrace bit in the process flags. */
......
...@@ -178,7 +178,8 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data) ...@@ -178,7 +178,8 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data)
/* are we already being traced? */ /* are we already being traced? */
if (current->ptrace & PT_PTRACED) if (current->ptrace & PT_PTRACED)
goto out; goto out;
if ((ret = security_ptrace(current->parent, current))) ret = security_ptrace(current->parent, current);
if (ret)
goto out; goto out;
/* set the ptrace bit in the process flags. */ /* set the ptrace bit in the process flags. */
current->ptrace |= PT_PTRACED; current->ptrace |= PT_PTRACED;
......
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