Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130322223117.GB14200@altlinux.org>
Date: Sat, 23 Mar 2013 02:31:17 +0400
From: "Dmitry V. Levin" <ldv@...linux.org>
To: owl-dev@...ts.openwall.com
Subject: Re: strace

On Wed, Mar 20, 2013 at 10:42:22PM +0100, Pavel Kankovsky wrote:
> On Fri, 15 Mar 2013, Dmitry V. Levin wrote:
> 
> >strace started to use "struct pt_regs" from asm/ptrace.h with commit
> >v4.6-124-geb0e3e8 that introduced PTRACE_GETREGS on x86.
> >
> >Recently (commit v4.7-82-g2550d48) strace was changed on x86* to stop
> >including asm/ptrace.h and use "struct user_regs_struct" instead.
> 
> *slaps himself* It's obvious, isn't it?

Yes, thanks to your analysis, now it is.

> Strace in Owl-current is 4.7 and it calls PTRACE_GETREGS with struct 
> pt_regs. This means it is broken when compiled against older kernel 
> headers where pt_regs is different from user_regs_struct, namely
> 2.6.18-based kernel in Owl.

Who could suppose at the time of adding PTRACE_GETREGS support that the
structure returned by PTRACE_GETREGS on 2.6.18-based i386 kernel is not
"struct pt_regs" from kernel's <asm/ptrace.h> but
"struct user_regs_struct" from libc's <sys/user.h>?

The morale is simple: avoid using "struct pt_regs" on i386, it may bite
when you expect it less.


-- 
ldv

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.