Commit 31358bf7 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

LSM: change all usages of security_ops->ptrace() to security_ptrace()

parent e6ebd8d6
...@@ -719,8 +719,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) ...@@ -719,8 +719,7 @@ 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;
ret = security_ops->ptrace(current->parent, current); if ((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,8 +160,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) ...@@ -160,8 +160,7 @@ 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;
ret = security_ops->ptrace(current->parent, current); if ((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,8 +1101,7 @@ sys_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data, ...@@ -1101,8 +1101,7 @@ 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;
ret = security_ops->ptrace(current->parent, current); if ((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,8 +166,7 @@ int sys_ptrace(long request, long pid, long addr, long data) ...@@ -166,8 +166,7 @@ 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;
ret = security_ops->ptrace(current->parent, current); if ((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,8 +59,7 @@ int sys_ptrace(long request, long pid, long addr, long data) ...@@ -59,8 +59,7 @@ 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;
ret = security_ops->ptrace(current->parent, current); if ((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,8 +48,7 @@ int sys32_ptrace(long request, long pid, unsigned long addr, unsigned long data) ...@@ -48,8 +48,7 @@ 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;
ret = security_ops->ptrace(current->parent, current); if ((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;
......
...@@ -330,8 +330,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) ...@@ -330,8 +330,7 @@ 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;
ret = security_ops->ptrace(current->parent, current); if ((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;
......
...@@ -569,8 +569,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) ...@@ -569,8 +569,7 @@ 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;
ret = security_ops->ptrace(current->parent, current); if ((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,8 +291,7 @@ asmlinkage void do_ptrace(struct pt_regs *regs) ...@@ -291,8 +291,7 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
pt_error_return(regs, EPERM); pt_error_return(regs, EPERM);
goto out; goto out;
} }
ret = security_ops->ptrace(current->parent, current); if ((ret = security_ptrace(current->parent, current))) {
if (ret) {
pt_error_return(regs, -ret); pt_error_return(regs, -ret);
goto out; goto out;
} }
......
...@@ -140,8 +140,7 @@ asmlinkage void do_ptrace(struct pt_regs *regs) ...@@ -140,8 +140,7 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
pt_error_return(regs, EPERM); pt_error_return(regs, EPERM);
goto out; goto out;
} }
ret = security_ops->ptrace(current->parent, current); if ((ret = security_ptrace(current->parent, current))) {
if (ret) {
pt_error_return(regs, -ret); pt_error_return(regs, -ret);
goto out; goto out;
} }
......
...@@ -33,8 +33,7 @@ int sys_ptrace(long request, long pid, long addr, long data) ...@@ -33,8 +33,7 @@ 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;
ret = security_ops->ptrace(current->parent, current); if ((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,8 +178,7 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data) ...@@ -178,8 +178,7 @@ 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;
ret = security_ops->ptrace(current->parent, current); if ((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;
......
...@@ -101,8 +101,7 @@ int ptrace_attach(struct task_struct *task) ...@@ -101,8 +101,7 @@ int ptrace_attach(struct task_struct *task)
/* the same process cannot be attached many times */ /* the same process cannot be attached many times */
if (task->ptrace & PT_PTRACED) if (task->ptrace & PT_PTRACED)
goto bad; goto bad;
retval = security_ops->ptrace(current, task); if ((retval = security_ptrace(current, task)))
if (retval)
goto bad; goto bad;
/* Go */ /* Go */
......
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