Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 20 Mar 2013 22:42:22 +0100 (CET)
From: Pavel Kankovsky <peak@...o.troja.mff.cuni.cz>
To: owl-dev@...ts.openwall.com
Subject: Re: strace

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?

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.

The attached patch (it is, in fact, a stripped down version of commit 
2550d48) fixes the problem.

-- 
Pavel Kankovsky aka Peak                          / Jeremiah 9:21        \
"For death is come up into our MS Windows(tm)..." \ 21st century edition /
--- strace-4.7/defs.h.orig	2012-04-28 14:58:35 +0200
+++ strace-4.7/defs.h	2013-03-20 21:36:52 +0100
@@ -318,7 +318,7 @@ extern long ptrace(int, int, char *, lon
 #endif
 
 #if defined(I386)
-extern struct pt_regs i386_regs;
+extern struct user_regs_struct i386_regs;
 #endif
 #if defined(IA64)
 extern long ia32;
--- strace-4.7/syscall.c.orig	2012-04-18 17:02:40 +0200
+++ strace-4.7/syscall.c	2013-03-20 21:37:36 +0100
@@ -633,7 +633,7 @@ is_restart_error(struct tcb *tcp)
 }
 
 #if defined(I386)
-struct pt_regs i386_regs;
+struct user_regs_struct i386_regs;
 #elif defined(X86_64) || defined(X32)
 /*
  * On 32 bits, pt_regs and user_regs_struct are the same,

Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ