aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/binfmt_aout.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/binfmt_aout.c b/fs/binfmt_aout.c
index f312103434d4..517e111bb7ef 100644
--- a/fs/binfmt_aout.c
+++ b/fs/binfmt_aout.c
@@ -278,6 +278,13 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
278 return -ENOEXEC; 278 return -ENOEXEC;
279 } 279 }
280 280
281 /*
282 * Requires a mmap handler. This prevents people from using a.out
283 * as part of an exploit attack against /proc-related vulnerabilities.
284 */
285 if (!bprm->file->f_op || !bprm->file->f_op->mmap)
286 return -ENOEXEC;
287
281 fd_offset = N_TXTOFF(ex); 288 fd_offset = N_TXTOFF(ex);
282 289
283 /* Check initial limits. This avoids letting people circumvent 290 /* Check initial limits. This avoids letting people circumvent
@@ -476,6 +483,13 @@ static int load_aout_library(struct file *file)
476 goto out; 483 goto out;
477 } 484 }
478 485
486 /*
487 * Requires a mmap handler. This prevents people from using a.out
488 * as part of an exploit attack against /proc-related vulnerabilities.
489 */
490 if (!file->f_op || !file->f_op->mmap)
491 goto out;
492
479 if (N_FLAGS(ex)) 493 if (N_FLAGS(ex))
480 goto out; 494 goto out;
481 495