diff options
Diffstat (limited to 'arch/x86/ia32/ia32_aout.c')
-rw-r--r-- | arch/x86/ia32/ia32_aout.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/x86/ia32/ia32_aout.c b/arch/x86/ia32/ia32_aout.c index a703af19c281..03abf9b70011 100644 --- a/arch/x86/ia32/ia32_aout.c +++ b/arch/x86/ia32/ia32_aout.c | |||
@@ -271,7 +271,7 @@ static int load_aout_binary(struct linux_binprm *bprm) | |||
271 | if ((N_MAGIC(ex) != ZMAGIC && N_MAGIC(ex) != OMAGIC && | 271 | if ((N_MAGIC(ex) != ZMAGIC && N_MAGIC(ex) != OMAGIC && |
272 | N_MAGIC(ex) != QMAGIC && N_MAGIC(ex) != NMAGIC) || | 272 | N_MAGIC(ex) != QMAGIC && N_MAGIC(ex) != NMAGIC) || |
273 | N_TRSIZE(ex) || N_DRSIZE(ex) || | 273 | N_TRSIZE(ex) || N_DRSIZE(ex) || |
274 | i_size_read(bprm->file->f_path.dentry->d_inode) < | 274 | i_size_read(file_inode(bprm->file)) < |
275 | ex.a_text+ex.a_data+N_SYMSIZE(ex)+N_TXTOFF(ex)) { | 275 | ex.a_text+ex.a_data+N_SYMSIZE(ex)+N_TXTOFF(ex)) { |
276 | return -ENOEXEC; | 276 | return -ENOEXEC; |
277 | } | 277 | } |
@@ -425,12 +425,10 @@ beyond_if: | |||
425 | 425 | ||
426 | static int load_aout_library(struct file *file) | 426 | static int load_aout_library(struct file *file) |
427 | { | 427 | { |
428 | struct inode *inode; | ||
429 | unsigned long bss, start_addr, len, error; | 428 | unsigned long bss, start_addr, len, error; |
430 | int retval; | 429 | int retval; |
431 | struct exec ex; | 430 | struct exec ex; |
432 | 431 | ||
433 | inode = file->f_path.dentry->d_inode; | ||
434 | 432 | ||
435 | retval = -ENOEXEC; | 433 | retval = -ENOEXEC; |
436 | error = kernel_read(file, 0, (char *) &ex, sizeof(ex)); | 434 | error = kernel_read(file, 0, (char *) &ex, sizeof(ex)); |
@@ -440,7 +438,7 @@ static int load_aout_library(struct file *file) | |||
440 | /* We come in here for the regular a.out style of shared libraries */ | 438 | /* We come in here for the regular a.out style of shared libraries */ |
441 | if ((N_MAGIC(ex) != ZMAGIC && N_MAGIC(ex) != QMAGIC) || N_TRSIZE(ex) || | 439 | if ((N_MAGIC(ex) != ZMAGIC && N_MAGIC(ex) != QMAGIC) || N_TRSIZE(ex) || |
442 | N_DRSIZE(ex) || ((ex.a_entry & 0xfff) && N_MAGIC(ex) == ZMAGIC) || | 440 | N_DRSIZE(ex) || ((ex.a_entry & 0xfff) && N_MAGIC(ex) == ZMAGIC) || |
443 | i_size_read(inode) < | 441 | i_size_read(file_inode(file)) < |
444 | ex.a_text+ex.a_data+N_SYMSIZE(ex)+N_TXTOFF(ex)) { | 442 | ex.a_text+ex.a_data+N_SYMSIZE(ex)+N_TXTOFF(ex)) { |
445 | goto out; | 443 | goto out; |
446 | } | 444 | } |