asm-ppc64/ptrace.h / fscpr

Dave Hansen haveblue at us.ibm.com
Thu May 20 07:23:52 EST 2004


On Wed, 2004-05-19 at 13:17, Steve Munroe wrote:
> Marcus Meissner <meissner at suse.de> wrote on 05/19/2004 10:44:26 AM:
>
> >
> > The fpscr offset is wrong, it is at position 32 in the FPR array on
> ppc64.
> >
> > Found by IBM gdb testing.
> >
> > I have the vague suspicion the ptrace32 compat handling might be broken
> too,
> > but I have to check.
> >
>
> #define PT_FPR0 48
> #define PT_FPSCR (PT_FPR0 + 32 + 1)
>
> So how is this wrong? Is the kernel storing the FPSCR in the wrong slot?

It only uses those values to bounds-check ptrace poke and peek register
accesses.  There are 33 registers to poke, which are register array
indexes 0->32.  The bounds check is against (index > PT_FPSCR), which
allows for an access of index 33, which is out-of-bounds.

-- Dave


** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc64-dev mailing list