aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/ia32/ia32_aout.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-05-01 20:51:54 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-01 20:51:54 -0400
commit20b4fb485227404329e41ad15588afad3df23050 (patch)
treef3e099f0ab3da8a93b447203e294d2bb22f6dc05 /arch/x86/ia32/ia32_aout.c
parentb9394d8a657cd3c064fa432aa0905c1b58b38fe9 (diff)
parentac3e3c5b1164397656df81b9e9ab4991184d3236 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull VFS updates from Al Viro, Misc cleanups all over the place, mainly wrt /proc interfaces (switch create_proc_entry to proc_create(), get rid of the deprecated create_proc_read_entry() in favor of using proc_create_data() and seq_file etc). 7kloc removed. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (204 commits) don't bother with deferred freeing of fdtables proc: Move non-public stuff from linux/proc_fs.h to fs/proc/internal.h proc: Make the PROC_I() and PDE() macros internal to procfs proc: Supply a function to remove a proc entry by PDE take cgroup_open() and cpuset_open() to fs/proc/base.c ppc: Clean up scanlog ppc: Clean up rtas_flash driver somewhat hostap: proc: Use remove_proc_subtree() drm: proc: Use remove_proc_subtree() drm: proc: Use minor->index to label things, not PDE->name drm: Constify drm_proc_list[] zoran: Don't print proc_dir_entry data in debug reiserfs: Don't access the proc_dir_entry in r_open(), r_start() r_show() proc: Supply an accessor for getting the data from a PDE's parent airo: Use remove_proc_subtree() rtl8192u: Don't need to save device proc dir PDE rtl8187se: Use a dir under /proc/net/r8180/ proc: Add proc_mkdir_data() proc: Move some bits from linux/proc_fs.h to linux/{of.h,signal.h,tty.h} proc: Move PDE_NET() to fs/proc/proc_net.c ...
Diffstat (limited to 'arch/x86/ia32/ia32_aout.c')
-rw-r--r--arch/x86/ia32/ia32_aout.c30
1 files changed, 6 insertions, 24 deletions
diff --git a/arch/x86/ia32/ia32_aout.c b/arch/x86/ia32/ia32_aout.c
index 81e94d972f1b..805078e08013 100644
--- a/arch/x86/ia32/ia32_aout.c
+++ b/arch/x86/ia32/ia32_aout.c
@@ -322,11 +322,8 @@ static int load_aout_binary(struct linux_binprm *bprm)
322 322
323 if (N_MAGIC(ex) == OMAGIC) { 323 if (N_MAGIC(ex) == OMAGIC) {
324 unsigned long text_addr, map_size; 324 unsigned long text_addr, map_size;
325 loff_t pos;
326 325
327 text_addr = N_TXTADDR(ex); 326 text_addr = N_TXTADDR(ex);
328
329 pos = 32;
330 map_size = ex.a_text+ex.a_data; 327 map_size = ex.a_text+ex.a_data;
331 328
332 error = vm_brk(text_addr & PAGE_MASK, map_size); 329 error = vm_brk(text_addr & PAGE_MASK, map_size);
@@ -336,15 +333,12 @@ static int load_aout_binary(struct linux_binprm *bprm)
336 return error; 333 return error;
337 } 334 }
338 335
339 error = bprm->file->f_op->read(bprm->file, 336 error = read_code(bprm->file, text_addr, 32,
340 (char __user *)text_addr, 337 ex.a_text + ex.a_data);
341 ex.a_text+ex.a_data, &pos);
342 if ((signed long)error < 0) { 338 if ((signed long)error < 0) {
343 send_sig(SIGKILL, current, 0); 339 send_sig(SIGKILL, current, 0);
344 return error; 340 return error;
345 } 341 }
346
347 flush_icache_range(text_addr, text_addr+ex.a_text+ex.a_data);
348 } else { 342 } else {
349#ifdef WARN_OLD 343#ifdef WARN_OLD
350 static unsigned long error_time, error_time2; 344 static unsigned long error_time, error_time2;
@@ -366,15 +360,9 @@ static int load_aout_binary(struct linux_binprm *bprm)
366#endif 360#endif
367 361
368 if (!bprm->file->f_op->mmap || (fd_offset & ~PAGE_MASK) != 0) { 362 if (!bprm->file->f_op->mmap || (fd_offset & ~PAGE_MASK) != 0) {
369 loff_t pos = fd_offset;
370
371 vm_brk(N_TXTADDR(ex), ex.a_text+ex.a_data); 363 vm_brk(N_TXTADDR(ex), ex.a_text+ex.a_data);
372 bprm->file->f_op->read(bprm->file, 364 read_code(bprm->file, N_TXTADDR(ex), fd_offset,
373 (char __user *)N_TXTADDR(ex), 365 ex.a_text+ex.a_data);
374 ex.a_text+ex.a_data, &pos);
375 flush_icache_range((unsigned long) N_TXTADDR(ex),
376 (unsigned long) N_TXTADDR(ex) +
377 ex.a_text+ex.a_data);
378 goto beyond_if; 366 goto beyond_if;
379 } 367 }
380 368
@@ -451,8 +439,6 @@ static int load_aout_library(struct file *file)
451 start_addr = ex.a_entry & 0xfffff000; 439 start_addr = ex.a_entry & 0xfffff000;
452 440
453 if ((N_TXTOFF(ex) & ~PAGE_MASK) != 0) { 441 if ((N_TXTOFF(ex) & ~PAGE_MASK) != 0) {
454 loff_t pos = N_TXTOFF(ex);
455
456#ifdef WARN_OLD 442#ifdef WARN_OLD
457 static unsigned long error_time; 443 static unsigned long error_time;
458 if (time_after(jiffies, error_time + 5*HZ)) { 444 if (time_after(jiffies, error_time + 5*HZ)) {
@@ -465,12 +451,8 @@ static int load_aout_library(struct file *file)
465#endif 451#endif
466 vm_brk(start_addr, ex.a_text + ex.a_data + ex.a_bss); 452 vm_brk(start_addr, ex.a_text + ex.a_data + ex.a_bss);
467 453
468 file->f_op->read(file, (char __user *)start_addr, 454 read_code(file, start_addr, N_TXTOFF(ex),
469 ex.a_text + ex.a_data, &pos); 455 ex.a_text + ex.a_data);
470 flush_icache_range((unsigned long) start_addr,
471 (unsigned long) start_addr + ex.a_text +
472 ex.a_data);
473
474 retval = 0; 456 retval = 0;
475 goto out; 457 goto out;
476 } 458 }