Re: [patch] ac17: alpha ptrace fix

From: Philipp Rumpf (prumpf@puffin.external.hp.com)
Date: Tue Jun 13 2000 - 08:17:48 EST


On Tue, Jun 13, 2000 at 02:52:02PM +0400, Ivan Kokshaysky wrote:
> Just an obvious 'search & replace' changes.
>
> Ivan.
>
> diff -ur 2.4.0t1ac17/arch/alpha/kernel/entry.S linux/arch/alpha/kernel/entry.S
> --- 2.4.0t1ac17/arch/alpha/kernel/entry.S Tue Apr 25 00:39:34 2000
> +++ linux/arch/alpha/kernel/entry.S Tue Jun 13 13:49:18 2000
> @@ -34,11 +34,12 @@
> #define TASK_EXEC_DOMAIN 32
> #define TASK_NEED_RESCHED 40
> #define TASK_PROCESSOR 100
> +#define TASK_PTRACE 104
>
> /*
> * task flags (must match include/linux/sched.h):
> */
> -#define PF_PTRACED 0x00000010
> +#define PT_PTRACED 0x00000001
>
> #define CLONE_VM 0x00000100
>
> @@ -557,10 +558,10 @@
> lda $5,sys_call_table
> lda $27,sys_ni_syscall
> cmpult $0,$4,$4
> - ldq $3,TASK_FLAGS($8)
> + ldq $3,TASK_PTRACE($8)
> stq $17,SP_OFF+32($30)
> s8addq $0,$5,$5
> - and $3,PF_PTRACED,$3
> + and $3,PT_PTRACED,$3
> stq $18,SP_OFF+40($30)
> bne $3,strace
> beq $4,1f

That's an unaligned access. What actually probably happens is there is
padding between .processor and .ptrace. While this isn't news
(last_processor is an int between two pointers), we probably shouldn't
rely on the compiler padding structs in assembly.

So changing TASK_PTRACE to be 108 seems to be the easiest fix for now.

        Philipp Rumpf

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Jun 15 2000 - 21:00:28 EST