diff options
-rw-r--r-- | arch/arm/include/asm/ptrace.h | 8 | ||||
-rw-r--r-- | arch/arm/kernel/ptrace.c | 8 |
2 files changed, 15 insertions, 1 deletions
diff --git a/arch/arm/include/asm/ptrace.h b/arch/arm/include/asm/ptrace.h index 67b833c9b6b9..bbecccda76d0 100644 --- a/arch/arm/include/asm/ptrace.h +++ b/arch/arm/include/asm/ptrace.h | |||
@@ -82,6 +82,14 @@ | |||
82 | #define PSR_ENDSTATE 0 | 82 | #define PSR_ENDSTATE 0 |
83 | #endif | 83 | #endif |
84 | 84 | ||
85 | /* | ||
86 | * These are 'magic' values for PTRACE_PEEKUSR that return info about where a | ||
87 | * process is located in memory. | ||
88 | */ | ||
89 | #define PT_TEXT_ADDR 0x10000 | ||
90 | #define PT_DATA_ADDR 0x10004 | ||
91 | #define PT_TEXT_END_ADDR 0x10008 | ||
92 | |||
85 | #ifndef __ASSEMBLY__ | 93 | #ifndef __ASSEMBLY__ |
86 | 94 | ||
87 | /* | 95 | /* |
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c index 89882a1d0187..a2ea3854cb3c 100644 --- a/arch/arm/kernel/ptrace.c +++ b/arch/arm/kernel/ptrace.c | |||
@@ -521,7 +521,13 @@ static int ptrace_read_user(struct task_struct *tsk, unsigned long off, | |||
521 | return -EIO; | 521 | return -EIO; |
522 | 522 | ||
523 | tmp = 0; | 523 | tmp = 0; |
524 | if (off < sizeof(struct pt_regs)) | 524 | if (off == PT_TEXT_ADDR) |
525 | tmp = tsk->mm->start_code; | ||
526 | else if (off == PT_DATA_ADDR) | ||
527 | tmp = tsk->mm->start_data; | ||
528 | else if (off == PT_TEXT_END_ADDR) | ||
529 | tmp = tsk->mm->end_code; | ||
530 | else if (off < sizeof(struct pt_regs)) | ||
525 | tmp = get_user_reg(tsk, off >> 2); | 531 | tmp = get_user_reg(tsk, off >> 2); |
526 | 532 | ||
527 | return put_user(tmp, ret); | 533 | return put_user(tmp, ret); |