diff options
author | H. Peter Anvin <hpa@zytor.com> | 2008-02-07 03:15:57 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-07 11:42:30 -0500 |
commit | 6e16d89bcd668a95eb22add24c02d80890232b66 (patch) | |
tree | 8d5fcab14edac7d36c67e8a57abb5025cfaa2c2d /fs | |
parent | ed7b1889da256977574663689b598d88950bbd23 (diff) |
Sanitize the type of struct user.u_ar0
struct user.u_ar0 is defined to contain a pointer offset on all
architectures in which it is defined (all architectures which define an
a.out format except SPARC.) However, it has a pointer type in the headers,
which is pointless -- <asm/user.h> is not exported to userspace, and it
just makes the code messy.
Redefine the field as "unsigned long" (which is the same size as a pointer
on all Linux architectures) and change the setting code to user offsetof()
instead of hand-coded arithmetic.
Cc: Linux Arch Mailing List <linux-arch@vger.kernel.org>
Cc: Bryan Wu <bryan.wu@analog.com>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Lennert Buytenhek <kernel@wantstofly.org>
Cc: HÃ¥vard Skinnemoen <hskinnemoen@atmel.com>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Hirokazu Takata <takata@linux-m32r.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/binfmt_aout.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/binfmt_aout.c b/fs/binfmt_aout.c index 7596e1e94cde..7f65e71bf859 100644 --- a/fs/binfmt_aout.c +++ b/fs/binfmt_aout.c | |||
@@ -115,7 +115,7 @@ static int aout_core_dump(long signr, struct pt_regs *regs, struct file *file, u | |||
115 | current->flags |= PF_DUMPCORE; | 115 | current->flags |= PF_DUMPCORE; |
116 | strncpy(dump.u_comm, current->comm, sizeof(dump.u_comm)); | 116 | strncpy(dump.u_comm, current->comm, sizeof(dump.u_comm)); |
117 | #ifndef __sparc__ | 117 | #ifndef __sparc__ |
118 | dump.u_ar0 = (void *)(((unsigned long)(&dump.regs)) - ((unsigned long)(&dump))); | 118 | dump.u_ar0 = offsetof(struct user, regs); |
119 | #endif | 119 | #endif |
120 | dump.signal = signr; | 120 | dump.signal = signr; |
121 | dump_thread(regs, &dump); | 121 | dump_thread(regs, &dump); |