diff options
Diffstat (limited to 'fs/exec.c')
| -rw-r--r-- | fs/exec.c | 12 |
1 files changed, 4 insertions, 8 deletions
| @@ -42,13 +42,13 @@ | |||
| 42 | #include <linux/module.h> | 42 | #include <linux/module.h> |
| 43 | #include <linux/namei.h> | 43 | #include <linux/namei.h> |
| 44 | #include <linux/proc_fs.h> | 44 | #include <linux/proc_fs.h> |
| 45 | #include <linux/ptrace.h> | ||
| 46 | #include <linux/mount.h> | 45 | #include <linux/mount.h> |
| 47 | #include <linux/security.h> | 46 | #include <linux/security.h> |
| 48 | #include <linux/syscalls.h> | 47 | #include <linux/syscalls.h> |
| 49 | #include <linux/tsacct_kern.h> | 48 | #include <linux/tsacct_kern.h> |
| 50 | #include <linux/cn_proc.h> | 49 | #include <linux/cn_proc.h> |
| 51 | #include <linux/audit.h> | 50 | #include <linux/audit.h> |
| 51 | #include <linux/tracehook.h> | ||
| 52 | 52 | ||
| 53 | #include <asm/uaccess.h> | 53 | #include <asm/uaccess.h> |
| 54 | #include <asm/mmu_context.h> | 54 | #include <asm/mmu_context.h> |
| @@ -1071,13 +1071,8 @@ EXPORT_SYMBOL(prepare_binprm); | |||
| 1071 | 1071 | ||
| 1072 | static int unsafe_exec(struct task_struct *p) | 1072 | static int unsafe_exec(struct task_struct *p) |
| 1073 | { | 1073 | { |
| 1074 | int unsafe = 0; | 1074 | int unsafe = tracehook_unsafe_exec(p); |
| 1075 | if (p->ptrace & PT_PTRACED) { | 1075 | |
| 1076 | if (p->ptrace & PT_PTRACE_CAP) | ||
| 1077 | unsafe |= LSM_UNSAFE_PTRACE_CAP; | ||
| 1078 | else | ||
| 1079 | unsafe |= LSM_UNSAFE_PTRACE; | ||
| 1080 | } | ||
| 1081 | if (atomic_read(&p->fs->count) > 1 || | 1076 | if (atomic_read(&p->fs->count) > 1 || |
| 1082 | atomic_read(&p->files->count) > 1 || | 1077 | atomic_read(&p->files->count) > 1 || |
| 1083 | atomic_read(&p->sighand->count) > 1) | 1078 | atomic_read(&p->sighand->count) > 1) |
| @@ -1214,6 +1209,7 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs) | |||
| 1214 | read_unlock(&binfmt_lock); | 1209 | read_unlock(&binfmt_lock); |
| 1215 | retval = fn(bprm, regs); | 1210 | retval = fn(bprm, regs); |
| 1216 | if (retval >= 0) { | 1211 | if (retval >= 0) { |
| 1212 | tracehook_report_exec(fmt, bprm, regs); | ||
| 1217 | put_binfmt(fmt); | 1213 | put_binfmt(fmt); |
| 1218 | allow_write_access(bprm->file); | 1214 | allow_write_access(bprm->file); |
| 1219 | if (bprm->file) | 1215 | if (bprm->file) |
