Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 211492
b: refs/heads/master
c: 0eead9a
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Oct 14, 2010
1 parent 9452ea1 commit 0efeb62
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 23 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 53eeb64e808971207350386121f4bab12fa2f45f
refs/heads/master: 0eead9ab41da33644ae2c97c57ad03da636a0422
22 changes: 5 additions & 17 deletions trunk/arch/x86/ia32/ia32_aout.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include <asm/ia32.h>

#undef WARN_OLD
#undef CORE_DUMP /* probably broken */
#undef CORE_DUMP /* definitely broken */

static int load_aout_binary(struct linux_binprm *, struct pt_regs *regs);
static int load_aout_library(struct file *);
Expand Down Expand Up @@ -131,21 +131,15 @@ static void set_brk(unsigned long start, unsigned long end)
* macros to write out all the necessary info.
*/

static int dump_write(struct file *file, const void *addr, int nr)
{
return file->f_op->write(file, addr, nr, &file->f_pos) == nr;
}
#include <linux/coredump.h>

#define DUMP_WRITE(addr, nr) \
if (!dump_write(file, (void *)(addr), (nr))) \
goto end_coredump;

#define DUMP_SEEK(offset) \
if (file->f_op->llseek) { \
if (file->f_op->llseek(file, (offset), 0) != (offset)) \
goto end_coredump; \
} else \
file->f_pos = (offset)
#define DUMP_SEEK(offset) \
if (!dump_seek(file, offset)) \
goto end_coredump;

#define START_DATA() (u.u_tsize << PAGE_SHIFT)
#define START_STACK(u) (u.start_stack)
Expand Down Expand Up @@ -217,12 +211,6 @@ static int aout_core_dump(long signr, struct pt_regs *regs, struct file *file,
dump_size = dump.u_ssize << PAGE_SHIFT;
DUMP_WRITE(dump_start, dump_size);
}
/*
* Finally dump the task struct. Not be used by gdb, but
* could be useful
*/
set_fs(KERNEL_DS);
DUMP_WRITE(current, sizeof(*current));
end_coredump:
set_fs(fs);
return has_dumped;
Expand Down
4 changes: 0 additions & 4 deletions trunk/fs/binfmt_aout.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,6 @@ static int aout_core_dump(struct coredump_params *cprm)
if (!dump_write(file, dump_start, dump_size))
goto end_coredump;
}
/* Finally dump the task struct. Not be used by gdb, but could be useful */
set_fs(KERNEL_DS);
if (!dump_write(file, current, sizeof(*current)))
goto end_coredump;
end_coredump:
set_fs(fs);
return has_dumped;
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/coredump.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
static inline int dump_write(struct file *file, const void *addr, int nr)
{
return file->f_op->write(file, addr, nr, &file->f_pos) == nr;
return access_ok(VERIFY_READ, addr, nr) && file->f_op->write(file, addr, nr, &file->f_pos) == nr;
}

static inline int dump_seek(struct file *file, loff_t off)
Expand Down

0 comments on commit 0efeb62

Please sign in to comment.