linux/include/asm-powerpc
Michael Ellerman 30415f6a63 powerpc: Fix random memory corruption in merged elf.h
The merged verison of ELF_CORE_COPY_REGS is basically the PPC64 version, with
a memset that came from PPC and a few types abstracted out into #defines. But
it's not _quite_ right.

The first problem is we calculate the number of registers with:
        nregs = sizeof(struct pt_regs) / sizeof(ELF_GREG_TYPE)

For a 32-bit process on a 64-bit kernel that's bogus because the registers are
64 bits, but ELF_GREG_TYPE is u32, so nregs == 88 which is wrong.

The other problem is the memset, which assumes a struct pt_regs is smaller
than a struct elf_regs. For a 32-bit process on a 64-bit kernel that's false.

The fix is to calculate the number of regs using sizeof(unsigned long), which
should always be right, and just memset the whole damn thing _before_ copying
the registers in.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
2005-11-04 12:10:51 +11:00
..
2005-10-11 09:59:38 +10:00
2005-11-01 21:49:02 +11:00
2005-11-02 15:19:47 +11:00
2005-09-28 15:42:53 +10:00
2005-09-22 21:03:33 +10:00
2005-11-02 14:48:18 +11:00
2005-11-02 14:48:05 +11:00
2005-11-01 21:02:44 +11:00
2005-10-27 20:50:54 +10:00
2005-11-02 14:48:18 +11:00
2005-10-28 22:53:37 +10:00
2005-10-31 13:37:12 +11:00
2005-10-31 13:37:12 +11:00
2005-11-01 14:36:55 +11:00
2005-10-12 08:24:47 -07:00
2005-10-27 16:45:50 +10:00
2005-11-01 15:53:19 +11:00
2005-10-31 13:37:12 +11:00
2005-09-21 19:21:09 +10:00
2005-10-28 22:53:37 +10:00