Commit 2dc559c8 authored by Russell King's avatar Russell King

[ARM] Add security framework hooks (ptrace and syscall)

parent b8d99b4c
...@@ -237,7 +237,7 @@ __syscall_start: ...@@ -237,7 +237,7 @@ __syscall_start:
/* 220 */ .long sys_madvise /* 220 */ .long sys_madvise
.long sys_fcntl64 .long sys_fcntl64
.long sys_ni_syscall /* TUX */ .long sys_ni_syscall /* TUX */
.long sys_ni_syscall /* Security */ .long sys_security
.long sys_gettid .long sys_gettid
/* 225 */ .long sys_readahead /* 225 */ .long sys_readahead
.long sys_setxattr .long sys_setxattr
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <linux/smp_lock.h> #include <linux/smp_lock.h>
#include <linux/ptrace.h> #include <linux/ptrace.h>
#include <linux/user.h> #include <linux/user.h>
#include <linux/security.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
...@@ -655,6 +656,9 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) ...@@ -655,6 +656,9 @@ 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)
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;
ret = 0; ret = 0;
......
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