aboutsummaryrefslogtreecommitdiffstats
path: root/fs/binfmt_aout.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/binfmt_aout.c')
-rw-r--r--fs/binfmt_aout.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/binfmt_aout.c b/fs/binfmt_aout.c
index 89dec7f789a4..ca0ba15a7306 100644
--- a/fs/binfmt_aout.c
+++ b/fs/binfmt_aout.c
@@ -45,7 +45,6 @@ static int load_aout_library(struct file*);
45 */ 45 */
46static int aout_core_dump(struct coredump_params *cprm) 46static int aout_core_dump(struct coredump_params *cprm)
47{ 47{
48 struct file *file = cprm->file;
49 mm_segment_t fs; 48 mm_segment_t fs;
50 int has_dumped = 0; 49 int has_dumped = 0;
51 void __user *dump_start; 50 void __user *dump_start;
@@ -85,10 +84,10 @@ static int aout_core_dump(struct coredump_params *cprm)
85 84
86 set_fs(KERNEL_DS); 85 set_fs(KERNEL_DS);
87/* struct user */ 86/* struct user */
88 if (!dump_write(file, &dump, sizeof(dump))) 87 if (!dump_emit(cprm, &dump, sizeof(dump)))
89 goto end_coredump; 88 goto end_coredump;
90/* Now dump all of the user data. Include malloced stuff as well */ 89/* Now dump all of the user data. Include malloced stuff as well */
91 if (!dump_seek(cprm->file, PAGE_SIZE - sizeof(dump))) 90 if (!dump_skip(cprm, PAGE_SIZE - sizeof(dump)))
92 goto end_coredump; 91 goto end_coredump;
93/* now we start writing out the user space info */ 92/* now we start writing out the user space info */
94 set_fs(USER_DS); 93 set_fs(USER_DS);
@@ -96,14 +95,14 @@ static int aout_core_dump(struct coredump_params *cprm)
96 if (dump.u_dsize != 0) { 95 if (dump.u_dsize != 0) {
97 dump_start = START_DATA(dump); 96 dump_start = START_DATA(dump);
98 dump_size = dump.u_dsize << PAGE_SHIFT; 97 dump_size = dump.u_dsize << PAGE_SHIFT;
99 if (!dump_write(file, dump_start, dump_size)) 98 if (!dump_emit(cprm, dump_start, dump_size))
100 goto end_coredump; 99 goto end_coredump;
101 } 100 }
102/* Now prepare to dump the stack area */ 101/* Now prepare to dump the stack area */
103 if (dump.u_ssize != 0) { 102 if (dump.u_ssize != 0) {
104 dump_start = START_STACK(dump); 103 dump_start = START_STACK(dump);
105 dump_size = dump.u_ssize << PAGE_SHIFT; 104 dump_size = dump.u_ssize << PAGE_SHIFT;
106 if (!dump_write(file, dump_start, dump_size)) 105 if (!dump_emit(cprm, dump_start, dump_size))
107 goto end_coredump; 106 goto end_coredump;
108 } 107 }
109end_coredump: 108end_coredump:
@@ -221,7 +220,7 @@ static int load_aout_binary(struct linux_binprm * bprm)
221 * Requires a mmap handler. This prevents people from using a.out 220 * Requires a mmap handler. This prevents people from using a.out
222 * as part of an exploit attack against /proc-related vulnerabilities. 221 * as part of an exploit attack against /proc-related vulnerabilities.
223 */ 222 */
224 if (!bprm->file->f_op || !bprm->file->f_op->mmap) 223 if (!bprm->file->f_op->mmap)
225 return -ENOEXEC; 224 return -ENOEXEC;
226 225
227 fd_offset = N_TXTOFF(ex); 226 fd_offset = N_TXTOFF(ex);
@@ -374,7 +373,7 @@ static int load_aout_library(struct file *file)
374 * Requires a mmap handler. This prevents people from using a.out 373 * Requires a mmap handler. This prevents people from using a.out
375 * as part of an exploit attack against /proc-related vulnerabilities. 374 * as part of an exploit attack against /proc-related vulnerabilities.
376 */ 375 */
377 if (!file->f_op || !file->f_op->mmap) 376 if (!file->f_op->mmap)
378 goto out; 377 goto out;
379 378
380 if (N_FLAGS(ex)) 379 if (N_FLAGS(ex))