]> Pileus Git - ~andy/linux/commitdiff
arm64: Do not export the compat-specific definitions to the user
authorCatalin Marinas <catalin.marinas@arm.com>
Wed, 10 Oct 2012 14:50:03 +0000 (15:50 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Thu, 11 Oct 2012 09:39:08 +0000 (10:39 +0100)
This patch adds #ifdef __KERNEL__ guards around the COMPAT_* definitions
to avoid exporting them to user. AArch32 user requiring the kernel
headers must use those generated with ARCH=arm.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
arch/arm64/include/asm/hwcap.h
arch/arm64/include/asm/ptrace.h
arch/arm64/kernel/ptrace.c

index db05f97661127ef5c16a0ab9c7c42794a1cee8f1..2cb430082edfdaf0a63fe3825f4880033b9e01f4 100644 (file)
@@ -22,6 +22,7 @@
 #define HWCAP_FP               (1 << 0)
 #define HWCAP_ASIMD            (1 << 1)
 
+#ifdef __KERNEL__
 #define COMPAT_HWCAP_HALF      (1 << 1)
 #define COMPAT_HWCAP_THUMB     (1 << 2)
 #define COMPAT_HWCAP_FAST_MULT (1 << 4)
@@ -35,7 +36,6 @@
 #define COMPAT_HWCAP_IDIVT     (1 << 18)
 #define COMPAT_HWCAP_IDIV      (COMPAT_HWCAP_IDIVA|COMPAT_HWCAP_IDIVT)
 
-#ifdef __KERNEL__
 #ifndef __ASSEMBLY__
 /*
  * This yields a mask that user programs can use to figure out what
index 0fa5d6c9ef76ad87ca1e28690c0cb7c49dee30c0..fc2772a27c78f83bf85cd0015d74bf1b6f5e352b 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <asm/hwcap.h>
 
+#ifdef __KERNEL__
 /* AArch32-specific ptrace requests */
 #define COMPAT_PTRACE_GETREGS          12
 #define COMPAT_PTRACE_SETREGS          13
@@ -32,6 +33,7 @@
 #define COMPAT_PTRACE_SETVFPREGS       28
 #define COMPAT_PTRACE_GETHBPREGS       29
 #define COMPAT_PTRACE_SETHBPREGS       30
+#endif
 
 /*
  * PSR bits
 
 /* AArch32 CPSR bits */
 #define PSR_MODE32_BIT         0x00000010
+#ifdef __KERNEL__
 #define COMPAT_PSR_MODE_USR    0x00000010
 #define COMPAT_PSR_T_BIT       0x00000020
 #define COMPAT_PSR_IT_MASK     0x0600fc00      /* If-Then execution state mask */
+#endif
 
 /* AArch64 SPSR bits */
 #define PSR_F_BIT      0x00000040
 #define PSR_x          0x0000ff00      /* Extension            */
 #define PSR_c          0x000000ff      /* Control              */
 
+#ifdef __KERNEL__
 /*
  * These are 'magic' values for PTRACE_PEEKUSR that return info about where a
  * process is located in memory.
  */
-#define PT_TEXT_ADDR           0x10000
-#define PT_DATA_ADDR           0x10004
-#define PT_TEXT_END_ADDR       0x10008
+#define COMPAT_PT_TEXT_ADDR            0x10000
+#define COMPAT_PT_DATA_ADDR            0x10004
+#define COMPAT_PT_TEXT_END_ADDR                0x10008
+#endif
 
 #ifndef __ASSEMBLY__
 
index ac3550ecc7b5c1f15c09bd3a20be8f5b459570bb..2ea3968367c265f99830db7f365668919f5f6a7c 100644 (file)
@@ -823,11 +823,11 @@ static int compat_ptrace_read_user(struct task_struct *tsk, compat_ulong_t off,
        if (off & 3)
                return -EIO;
 
-       if (off == PT_TEXT_ADDR)
+       if (off == COMPAT_PT_TEXT_ADDR)
                tmp = tsk->mm->start_code;
-       else if (off == PT_DATA_ADDR)
+       else if (off == COMPAT_PT_DATA_ADDR)
                tmp = tsk->mm->start_data;
-       else if (off == PT_TEXT_END_ADDR)
+       else if (off == COMPAT_PT_TEXT_END_ADDR)
                tmp = tsk->mm->end_code;
        else if (off < sizeof(compat_elf_gregset_t))
                return copy_regset_to_user(tsk, &user_aarch32_view,