The patch titled
     Sanitize the type of struct user.u_ar0
has been removed from the -mm tree.  Its filename was
     sanitize-the-type-of-struct-useru_ar0.patch

This patch was dropped because it was merged into mainline or a subsystem tree

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: Sanitize the type of struct user.u_ar0
From: "H. Peter Anvin" <[EMAIL PROTECTED]>

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 <[email protected]>
Cc: Bryan Wu <[EMAIL PROTECTED]>
Cc: Roman Zippel <[EMAIL PROTECTED]>
Cc: Thomas Gleixner <[EMAIL PROTECTED]>
Cc: Ingo Molnar <[EMAIL PROTECTED]>
Cc: Richard Henderson <[EMAIL PROTECTED]>
Cc: Ivan Kokshaysky <[EMAIL PROTECTED]>
Cc: Russell King <[EMAIL PROTECTED]>
Cc: Lennert Buytenhek <[EMAIL PROTECTED]>
Cc: HÃ¥vard Skinnemoen <[EMAIL PROTECTED]>
Cc: Mikael Starvik <[EMAIL PROTECTED]>
Cc: Yoshinori Sato <[EMAIL PROTECTED]>
Cc: Tony Luck <[EMAIL PROTECTED]>
Cc: Hirokazu Takata <[EMAIL PROTECTED]>
Cc: Ralf Baechle <[EMAIL PROTECTED]>
Cc: Paul Mackerras <[EMAIL PROTECTED]>
Cc: Martin Schwidefsky <[EMAIL PROTECTED]>
Cc: Heiko Carstens <[EMAIL PROTECTED]>
Cc: Paul Mundt <[EMAIL PROTECTED]>
Signed-off-by: H. Peter Anvin <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 arch/x86/ia32/ia32_aout.c   |    3 +--
 fs/binfmt_aout.c            |    2 +-
 include/asm-alpha/user.h    |    2 +-
 include/asm-arm/user.h      |    2 +-
 include/asm-avr32/user.h    |    2 +-
 include/asm-blackfin/user.h |    2 +-
 include/asm-cris/user.h     |    2 +-
 include/asm-h8300/user.h    |    3 +--
 include/asm-ia64/user.h     |    2 +-
 include/asm-m32r/user.h     |    2 +-
 include/asm-m68k/user.h     |    3 +--
 include/asm-mips/user.h     |    2 +-
 include/asm-powerpc/user.h  |    2 +-
 include/asm-s390/user.h     |    3 +--
 include/asm-sh/user.h       |    2 +-
 include/asm-v850/user.h     |    2 +-
 include/asm-x86/user_32.h   |    2 +-
 include/asm-x86/user_64.h   |    2 +-
 18 files changed, 18 insertions(+), 22 deletions(-)

diff -puN arch/x86/ia32/ia32_aout.c~sanitize-the-type-of-struct-useru_ar0 
arch/x86/ia32/ia32_aout.c
--- a/arch/x86/ia32/ia32_aout.c~sanitize-the-type-of-struct-useru_ar0
+++ a/arch/x86/ia32/ia32_aout.c
@@ -172,8 +172,7 @@ static int aout_core_dump(long signr, st
        has_dumped = 1;
        current->flags |= PF_DUMPCORE;
        strncpy(dump.u_comm, current->comm, sizeof(current->comm));
-       dump.u_ar0 = (u32)(((unsigned long)(&dump.regs)) -
-                          ((unsigned long)(&dump)));
+       dump.u_ar0 = offsetof(struct user32, regs);
        dump.signal = signr;
        dump_thread32(regs, &dump);
 
diff -puN fs/binfmt_aout.c~sanitize-the-type-of-struct-useru_ar0 
fs/binfmt_aout.c
--- a/fs/binfmt_aout.c~sanitize-the-type-of-struct-useru_ar0
+++ a/fs/binfmt_aout.c
@@ -115,7 +115,7 @@ static int aout_core_dump(long signr, st
        current->flags |= PF_DUMPCORE;
                strncpy(dump.u_comm, current->comm, sizeof(dump.u_comm));
 #ifndef __sparc__
-       dump.u_ar0 = (void *)(((unsigned long)(&dump.regs)) - ((unsigned 
long)(&dump)));
+       dump.u_ar0 = offsetof(struct user, regs);
 #endif
        dump.signal = signr;
        dump_thread(regs, &dump);
diff -puN include/asm-alpha/user.h~sanitize-the-type-of-struct-useru_ar0 
include/asm-alpha/user.h
--- a/include/asm-alpha/user.h~sanitize-the-type-of-struct-useru_ar0
+++ a/include/asm-alpha/user.h
@@ -39,7 +39,7 @@ struct user {
        unsigned long   start_data;             /* data starting address */
        unsigned long   start_stack;            /* stack starting address */
        long int        signal;                 /* signal causing core dump */
-       struct regs *   u_ar0;                  /* help gdb find registers */
+       unsigned long   u_ar0;                  /* help gdb find registers */
        unsigned long   magic;                  /* identifies a core file */
        char            u_comm[32];             /* user command name */
 };
diff -puN include/asm-arm/user.h~sanitize-the-type-of-struct-useru_ar0 
include/asm-arm/user.h
--- a/include/asm-arm/user.h~sanitize-the-type-of-struct-useru_ar0
+++ a/include/asm-arm/user.h
@@ -67,7 +67,7 @@ struct user{
                                   esp register.  */
   long int signal;                     /* Signal that caused the core dump. */
   int reserved;                        /* No longer used */
-  struct pt_regs * u_ar0;      /* Used by gdb to help find the values for */
+  unsigned long u_ar0;         /* Used by gdb to help find the values for */
                                /* the registers. */
   unsigned long magic;         /* To uniquely identify a core file */
   char u_comm[32];             /* User command that was responsible */
diff -puN include/asm-avr32/user.h~sanitize-the-type-of-struct-useru_ar0 
include/asm-avr32/user.h
--- a/include/asm-avr32/user.h~sanitize-the-type-of-struct-useru_ar0
+++ a/include/asm-avr32/user.h
@@ -51,7 +51,7 @@ struct user {
        unsigned long   start_data;             /* data starting address */
        unsigned long   start_stack;            /* stack starting address */
        long int        signal;                 /* signal causing core dump */
-       struct regs *   u_ar0;                  /* help gdb find registers */
+       unsigned long   u_ar0;                  /* help gdb find registers */
        unsigned long   magic;                  /* identifies a core file */
        char            u_comm[32];             /* user command name */
 };
diff -puN include/asm-blackfin/user.h~sanitize-the-type-of-struct-useru_ar0 
include/asm-blackfin/user.h
--- a/include/asm-blackfin/user.h~sanitize-the-type-of-struct-useru_ar0
+++ a/include/asm-blackfin/user.h
@@ -75,7 +75,7 @@ struct user {
                                           esp register.  */
        long int signal;        /* Signal that caused the core dump. */
        int reserved;           /* No longer used */
-       struct user_regs_struct *u_ar0;
+       unsigned long u_ar0;
        /* Used by gdb to help find the values for */
        /* the registers. */
        unsigned long magic;    /* To uniquely identify a core file */
diff -puN include/asm-cris/user.h~sanitize-the-type-of-struct-useru_ar0 
include/asm-cris/user.h
--- a/include/asm-cris/user.h~sanitize-the-type-of-struct-useru_ar0
+++ a/include/asm-cris/user.h
@@ -38,7 +38,7 @@ struct user {
        unsigned long   start_data;             /* data starting address */
        unsigned long   start_stack;            /* stack starting address */
        long int        signal;                 /* signal causing core dump */
-       struct regs *   u_ar0;                  /* help gdb find registers */
+       unsigned long   u_ar0;                  /* help gdb find registers */
        unsigned long   magic;                  /* identifies a core file */
        char            u_comm[32];             /* user command name */
 };
diff -puN include/asm-h8300/user.h~sanitize-the-type-of-struct-useru_ar0 
include/asm-h8300/user.h
--- a/include/asm-h8300/user.h~sanitize-the-type-of-struct-useru_ar0
+++ a/include/asm-h8300/user.h
@@ -62,8 +62,7 @@ struct user{
                                   esp register.  */
   long int signal;                     /* Signal that caused the core dump. */
   int reserved;                        /* No longer used */
-  struct user_regs_struct *u_ar0;
-                               /* Used by gdb to help find the values for */
+  unsigned long u_ar0;         /* Used by gdb to help find the values for */
                                /* the registers. */
   unsigned long magic;         /* To uniquely identify a core file */
   char u_comm[32];             /* User command that was responsible */
diff -puN include/asm-ia64/user.h~sanitize-the-type-of-struct-useru_ar0 
include/asm-ia64/user.h
--- a/include/asm-ia64/user.h~sanitize-the-type-of-struct-useru_ar0
+++ a/include/asm-ia64/user.h
@@ -44,7 +44,7 @@ struct user {
        unsigned long   start_data;             /* data starting address */
        unsigned long   start_stack;            /* stack starting address */
        long int        signal;                 /* signal causing core dump */
-       struct regs *   u_ar0;                  /* help gdb find registers */
+       unsigned long   u_ar0;                  /* help gdb find registers */
        unsigned long   magic;                  /* identifies a core file */
        char            u_comm[32];             /* user command name */
 };
diff -puN include/asm-m32r/user.h~sanitize-the-type-of-struct-useru_ar0 
include/asm-m32r/user.h
--- a/include/asm-m32r/user.h~sanitize-the-type-of-struct-useru_ar0
+++ a/include/asm-m32r/user.h
@@ -38,7 +38,7 @@ struct user {
        unsigned long   start_data;             /* data starting address */
        unsigned long   start_stack;            /* stack starting address */
        long int        signal;                 /* signal causing core dump */
-       struct regs *   u_ar0;                  /* help gdb find registers */
+       unsigned long   u_ar0;                  /* help gdb find registers */
        unsigned long   magic;                  /* identifies a core file */
        char            u_comm[32];             /* user command name */
 };
diff -puN include/asm-m68k/user.h~sanitize-the-type-of-struct-useru_ar0 
include/asm-m68k/user.h
--- a/include/asm-m68k/user.h~sanitize-the-type-of-struct-useru_ar0
+++ a/include/asm-m68k/user.h
@@ -72,8 +72,7 @@ struct user{
                                   esp register.  */
   long int signal;             /* Signal that caused the core dump. */
   int reserved;                        /* No longer used */
-  struct user_regs_struct *u_ar0;
-                               /* Used by gdb to help find the values for */
+  unsigned long u_ar0;         /* Used by gdb to help find the values for */
                                /* the registers. */
   struct user_m68kfp_struct* u_fpstate;        /* Math Co-processor pointer. */
   unsigned long magic;         /* To uniquely identify a core file */
diff -puN include/asm-mips/user.h~sanitize-the-type-of-struct-useru_ar0 
include/asm-mips/user.h
--- a/include/asm-mips/user.h~sanitize-the-type-of-struct-useru_ar0
+++ a/include/asm-mips/user.h
@@ -44,7 +44,7 @@ struct user {
        unsigned long   start_data;             /* data starting address */
        unsigned long   start_stack;            /* stack starting address */
        long int        signal;                 /* signal causing core dump */
-       struct regs *   u_ar0;                  /* help gdb find registers */
+       unsigned long   u_ar0;                  /* help gdb find registers */
        unsigned long   magic;                  /* identifies a core file */
        char            u_comm[32];             /* user command name */
 };
diff -puN include/asm-powerpc/user.h~sanitize-the-type-of-struct-useru_ar0 
include/asm-powerpc/user.h
--- a/include/asm-powerpc/user.h~sanitize-the-type-of-struct-useru_ar0
+++ a/include/asm-powerpc/user.h
@@ -38,7 +38,7 @@ struct user {
        unsigned long   start_data;             /* data starting address */
        unsigned long   start_stack;            /* stack starting address */
        long int        signal;                 /* signal causing core dump */
-       struct regs *   u_ar0;                  /* help gdb find registers */
+       unsigned long   u_ar0;                  /* help gdb find registers */
        unsigned long   magic;                  /* identifies a core file */
        char            u_comm[32];             /* user command name */
 };
diff -puN include/asm-s390/user.h~sanitize-the-type-of-struct-useru_ar0 
include/asm-s390/user.h
--- a/include/asm-s390/user.h~sanitize-the-type-of-struct-useru_ar0
+++ a/include/asm-s390/user.h
@@ -63,8 +63,7 @@ struct user {
                                   the top of the stack is always found in the
                                   esp register.  */
   long int signal;                     /* Signal that caused the core dump. */
-  struct user_regs_struct *u_ar0;
-                               /* Used by gdb to help find the values for */
+  unsigned long u_ar0;         /* Used by gdb to help find the values for */
                                /* the registers. */
   unsigned long magic;         /* To uniquely identify a core file */
   char u_comm[32];             /* User command that was responsible */
diff -puN include/asm-sh/user.h~sanitize-the-type-of-struct-useru_ar0 
include/asm-sh/user.h
--- a/include/asm-sh/user.h~sanitize-the-type-of-struct-useru_ar0
+++ a/include/asm-sh/user.h
@@ -52,7 +52,7 @@ struct user {
        unsigned long   start_data;             /* data starting address */
        unsigned long   start_stack;            /* stack starting address */
        long int        signal;                 /* signal causing core dump */
-       struct regs *   u_ar0;                  /* help gdb find registers */
+       unsigned long   u_ar0;                  /* help gdb find registers */
        struct user_fpu_struct* u_fpstate;      /* Math Co-processor pointer */
        unsigned long   magic;                  /* identifies a core file */
        char            u_comm[32];             /* user command name */
diff -puN include/asm-v850/user.h~sanitize-the-type-of-struct-useru_ar0 
include/asm-v850/user.h
--- a/include/asm-v850/user.h~sanitize-the-type-of-struct-useru_ar0
+++ a/include/asm-v850/user.h
@@ -38,7 +38,7 @@ struct user {
        unsigned long   start_data;             /* data starting address */
        unsigned long   start_stack;            /* stack starting address */
        long int        signal;                 /* signal causing core dump */
-       struct regs *   u_ar0;                  /* help gdb find registers */
+       unsigned long   u_ar0;                  /* help gdb find registers */
        unsigned long   magic;                  /* identifies a core file */
        char            u_comm[32];             /* user command name */
 };
diff -puN include/asm-x86/user_32.h~sanitize-the-type-of-struct-useru_ar0 
include/asm-x86/user_32.h
--- a/include/asm-x86/user_32.h~sanitize-the-type-of-struct-useru_ar0
+++ a/include/asm-x86/user_32.h
@@ -116,7 +116,7 @@ struct user{
                                   esp register.  */
   long int signal;                     /* Signal that caused the core dump. */
   int reserved;                        /* No longer used */
-  struct user_pt_regs * u_ar0; /* Used by gdb to help find the values for */
+  unsigned long u_ar0;         /* Used by gdb to help find the values for */
                                /* the registers. */
   struct user_i387_struct* u_fpstate;  /* Math Co-processor pointer. */
   unsigned long magic;         /* To uniquely identify a core file */
diff -puN include/asm-x86/user_64.h~sanitize-the-type-of-struct-useru_ar0 
include/asm-x86/user_64.h
--- a/include/asm-x86/user_64.h~sanitize-the-type-of-struct-useru_ar0
+++ a/include/asm-x86/user_64.h
@@ -118,7 +118,7 @@ struct user{
   long int signal;             /* Signal that caused the core dump. */
   int reserved;                        /* No longer used */
   int pad1;
-  struct user_pt_regs * u_ar0; /* Used by gdb to help find the values for */
+  unsigned long u_ar0;         /* Used by gdb to help find the values for */
                                /* the registers. */
   struct user_i387_struct* u_fpstate;  /* Math Co-processor pointer. */
   unsigned long magic;         /* To uniquely identify a core file */
_

Patches currently in -mm which might be from [EMAIL PROTECTED] are

origin.patch
git-kvm.patch
git-x86.patch
x86_64-check-msr-to-get-mmconfig-for-amd-family-10h-opteron-v3.patch
x86_64-set-cfg_size-for-amd-family-10h-in-case-mmconfig-is-used.patch
avoid-overflows-in-kernel-timec.patch
mount-options-fix-autofs.patch
mount-options-fix-devpts.patch

-
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to