• Jeremy Fitzhardinge's avatar
    [PATCH] ptrace: Fix EFL_OFFSET value according to i386 pda changes · 8701ea95
    Jeremy Fitzhardinge authored
    The PDA patches introduced a bug in ptrace: it reads eflags from the wrong
    place on the target's stack, but writes it back to the correct place.  The
    result is a corrupted eflags, which is most visible when it turns interrupts
    off unexpectedly.
    
    This patch fixes this by making the ptrace code a little less fragile.  It
    changes [gs]et_stack_long to take a straightforward byte offset into struct
    pt_regs, rather than requiring all callers to do a sizeof(struct pt_regs)
    offset adjustment.  This means that the eflag's offset (EFL_OFFSET) on the
    target stack can be simply computed with offsetof().
    Signed-off-by: default avatarJeremy Fitzhardinge <jeremy@xensource.com>
    Cc: Frederik Deweerdt <deweerdt@free.fr>
    Cc: Andi Kleen <ak@suse.de>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    8701ea95
ptrace.c 18.6 KB