diff options
Diffstat (limited to 'fs/exec.c')
-rw-r--r-- | fs/exec.c | 44 |
1 files changed, 3 insertions, 41 deletions
@@ -57,11 +57,6 @@ | |||
57 | #include <asm/tlb.h> | 57 | #include <asm/tlb.h> |
58 | #include "internal.h" | 58 | #include "internal.h" |
59 | 59 | ||
60 | #ifdef __alpha__ | ||
61 | /* for /sbin/loader handling in search_binary_handler() */ | ||
62 | #include <linux/a.out.h> | ||
63 | #endif | ||
64 | |||
65 | int core_uses_pid; | 60 | int core_uses_pid; |
66 | char core_pattern[CORENAME_MAX_SIZE] = "core"; | 61 | char core_pattern[CORENAME_MAX_SIZE] = "core"; |
67 | int suid_dumpable = 0; | 62 | int suid_dumpable = 0; |
@@ -127,7 +122,8 @@ asmlinkage long sys_uselib(const char __user * library) | |||
127 | if (nd.path.mnt->mnt_flags & MNT_NOEXEC) | 122 | if (nd.path.mnt->mnt_flags & MNT_NOEXEC) |
128 | goto exit; | 123 | goto exit; |
129 | 124 | ||
130 | error = vfs_permission(&nd, MAY_READ | MAY_EXEC | MAY_OPEN); | 125 | error = inode_permission(nd.path.dentry->d_inode, |
126 | MAY_READ | MAY_EXEC | MAY_OPEN); | ||
131 | if (error) | 127 | if (error) |
132 | goto exit; | 128 | goto exit; |
133 | 129 | ||
@@ -680,7 +676,7 @@ struct file *open_exec(const char *name) | |||
680 | if (nd.path.mnt->mnt_flags & MNT_NOEXEC) | 676 | if (nd.path.mnt->mnt_flags & MNT_NOEXEC) |
681 | goto out_path_put; | 677 | goto out_path_put; |
682 | 678 | ||
683 | err = vfs_permission(&nd, MAY_EXEC | MAY_OPEN); | 679 | err = inode_permission(nd.path.dentry->d_inode, MAY_EXEC | MAY_OPEN); |
684 | if (err) | 680 | if (err) |
685 | goto out_path_put; | 681 | goto out_path_put; |
686 | 682 | ||
@@ -1171,41 +1167,7 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs) | |||
1171 | unsigned int depth = bprm->recursion_depth; | 1167 | unsigned int depth = bprm->recursion_depth; |
1172 | int try,retval; | 1168 | int try,retval; |
1173 | struct linux_binfmt *fmt; | 1169 | struct linux_binfmt *fmt; |
1174 | #ifdef __alpha__ | ||
1175 | /* handle /sbin/loader.. */ | ||
1176 | { | ||
1177 | struct exec * eh = (struct exec *) bprm->buf; | ||
1178 | 1170 | ||
1179 | if (!bprm->loader && eh->fh.f_magic == 0x183 && | ||
1180 | (eh->fh.f_flags & 0x3000) == 0x3000) | ||
1181 | { | ||
1182 | struct file * file; | ||
1183 | unsigned long loader; | ||
1184 | |||
1185 | allow_write_access(bprm->file); | ||
1186 | fput(bprm->file); | ||
1187 | bprm->file = NULL; | ||
1188 | |||
1189 | loader = bprm->vma->vm_end - sizeof(void *); | ||
1190 | |||
1191 | file = open_exec("/sbin/loader"); | ||
1192 | retval = PTR_ERR(file); | ||
1193 | if (IS_ERR(file)) | ||
1194 | return retval; | ||
1195 | |||
1196 | /* Remember if the application is TASO. */ | ||
1197 | bprm->taso = eh->ah.entry < 0x100000000UL; | ||
1198 | |||
1199 | bprm->file = file; | ||
1200 | bprm->loader = loader; | ||
1201 | retval = prepare_binprm(bprm); | ||
1202 | if (retval<0) | ||
1203 | return retval; | ||
1204 | /* should call search_binary_handler recursively here, | ||
1205 | but it does not matter */ | ||
1206 | } | ||
1207 | } | ||
1208 | #endif | ||
1209 | retval = security_bprm_check(bprm); | 1171 | retval = security_bprm_check(bprm); |
1210 | if (retval) | 1172 | if (retval) |
1211 | return retval; | 1173 | return retval; |