new helper: file_inode(file)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -271,7 +271,7 @@ static int load_aout_binary(struct linux_binprm *bprm)
|
||||
if ((N_MAGIC(ex) != ZMAGIC && N_MAGIC(ex) != OMAGIC &&
|
||||
N_MAGIC(ex) != QMAGIC && N_MAGIC(ex) != NMAGIC) ||
|
||||
N_TRSIZE(ex) || N_DRSIZE(ex) ||
|
||||
i_size_read(bprm->file->f_path.dentry->d_inode) <
|
||||
i_size_read(file_inode(bprm->file)) <
|
||||
ex.a_text+ex.a_data+N_SYMSIZE(ex)+N_TXTOFF(ex)) {
|
||||
return -ENOEXEC;
|
||||
}
|
||||
@@ -425,12 +425,10 @@ beyond_if:
|
||||
|
||||
static int load_aout_library(struct file *file)
|
||||
{
|
||||
struct inode *inode;
|
||||
unsigned long bss, start_addr, len, error;
|
||||
int retval;
|
||||
struct exec ex;
|
||||
|
||||
inode = file->f_path.dentry->d_inode;
|
||||
|
||||
retval = -ENOEXEC;
|
||||
error = kernel_read(file, 0, (char *) &ex, sizeof(ex));
|
||||
@@ -440,7 +438,7 @@ static int load_aout_library(struct file *file)
|
||||
/* We come in here for the regular a.out style of shared libraries */
|
||||
if ((N_MAGIC(ex) != ZMAGIC && N_MAGIC(ex) != QMAGIC) || N_TRSIZE(ex) ||
|
||||
N_DRSIZE(ex) || ((ex.a_entry & 0xfff) && N_MAGIC(ex) == ZMAGIC) ||
|
||||
i_size_read(inode) <
|
||||
i_size_read(file_inode(file)) <
|
||||
ex.a_text+ex.a_data+N_SYMSIZE(ex)+N_TXTOFF(ex)) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user