tags 459820 + patch
kthxbye

Patch attached that reawakens some disabled strace code. Output of testcase is
now:

<snip>
write(1, "--------------------\n", 21--------------------
)  = 21
[ Process PID=9059 runs in 32 bit mode. ]
fork([i am 9060]
)                                  = 9060
--- SIGCHLD (Child exited) @ 0 (0) ---
[ Process PID=9059 runs in 64 bit mode. ]
getpid()                                = 9059
write(1, "[i am 9059]\n", 12[i am 9059]
)           = 12
exit_group(0)                           = ?
Process 9059 detached


Regards,

-- 
Chris Lamb, UK                                       [EMAIL PROTECTED]
                                                            GPG: 0x634F9A20
--- syscall.c.orig      2008-01-11 08:51:23.000000000 +0000
+++ syscall.c   2008-01-11 08:52:40.000000000 +0000
@@ -944,34 +944,13 @@
                return -1;
 
        if (!(tcp->flags & TCB_INSYSCALL)) {
-               static int currpers=-1;
-               long val;
-
-               /* Check CS register value. On x86-64 linux it is:
-                *      0x33    for long mode (64 bit)
-                *      0x23    for compatibility mode (32 bit)
-                * It takes only one ptrace and thus doesn't need
-                * to be cached.
-                */
-               if (upeek(pid, 8*CS, &val) < 0)
-                       return -1;
-               switch(val)
-               {
-                       case 0x23: currpers = 1; break;
-                       case 0x33: currpers = 0; break;
-                       default:
-                               fprintf(stderr, "Unknown value CS=0x%02X while "
-                                        "detecting personality of process "
-                                        "PID=%d\n", (int)val, pid);
-                               currpers = current_personality;
-                               break;
-               }
-#if 0
-               /* This version analyzes the opcode of a syscall instruction.
+               /* Analyze the opcode of a syscall instruction.
                 * (int 0x80 on i386 vs. syscall on x86-64)
                 * It works, but is too complicated.
                 */
-               unsigned long val, rip, i;
+               static int currpers=-1;
+               unsigned long call;
+               long rip;
 
                if(upeek(pid, 8*RIP, &rip)<0)
                        perror("upeek(RIP)");
@@ -998,7 +977,6 @@
                                        "PID=%d\n", (int)call, pid);
                                break;
                }
-#endif
                if(currpers != current_personality)
                {
                        char *names[]={"64 bit", "32 bit"};

Attachment: signature.asc
Description: PGP signature

Reply via email to