Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 316309 Details for
Bug 162774
strace ignores int3 SIGTRAP
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Proof-of-concept patch
1.patch (text/plain), 2.81 KB, created by
Denys Vlasenko
on 2008-09-10 12:53:06 UTC
(
hide
)
Description:
Proof-of-concept patch
Filename:
MIME Type:
Creator:
Denys Vlasenko
Created:
2008-09-10 12:53:06 UTC
Size:
2.81 KB
patch
obsolete
>diff -d -urpN strace.0/strace.c strace.1/strace.c >--- strace.0/strace.c 2008-08-06 23:38:52.000000000 +0200 >+++ strace.1/strace.c 2008-09-10 14:18:32.000000000 +0200 >@@ -78,6 +78,8 @@ > #endif > #endif > >+int SIGTRAP80 = SIGTRAP; >+ > int debug = 0, followfork = 0; > int dtime = 0, cflag = 0, xflag = 0, qflag = 0; > static int iflag = 0, interactive = 0, pflag_seen = 0, rflag = 0, tflag = 0; >@@ -1541,9 +1543,9 @@ int sig; > } > break; > } >- if ((error = ptrace(PTRACE_CONT, tcp->pid, (char *) 1, >- WSTOPSIG(status) == SIGTRAP ? >- 0 : WSTOPSIG(status))) < 0) { >+ error = ptrace(PTRACE_CONT, tcp->pid, (char *) 1, >+ WSTOPSIG(status) == SIGTRAP80 ? 0 : WSTOPSIG(status)); >+ if (error < 0) { > if (errno != ESRCH) > perror("detach: ptrace(PTRACE_CONT, ...)"); > break; >@@ -2400,10 +2402,52 @@ Process %d attached (waiting for parent) > return -1; > } > } >+ /* Ask kernel to set signo to SIGTRAP | 0x80 >+ * on ptrace-generated SIGTRAPs */ >+//#if defined(PTRACE_SETOPTIONS) && defined(PTRACE_O_TRACESYSGOOD) >+ if (ptrace(PTRACE_SETOPTIONS, pid, (char *) 0, (void *) PTRACE_O_TRACESYSGOOD) == 0) { >+fprintf(stderr, "ptrace(PTRACE_SETOPTIONS, ..., PTRACE_O_TRACESYSGOOD) successful\n"); >+ SIGTRAP80 = SIGTRAP | 0x80; >+ } >+//#endif > goto tracing; > } > >- if (WSTOPSIG(status) != SIGTRAP) { >+ /* Kernel bug (observed on 2.6.25 x86_64): >+ * even if we set PTRACE_O_TRACESYSGOOD option, >+ * after execve(), post-syscall ptrace-generated SIGTRAP >+ * has signo == SIGTRAP, not (SIGTRAP | 0x80)! >+ * Detect it by looking at siginfo. >+ */ >+ if (SIGTRAP80 != SIGTRAP && WSTOPSIG(status) == SIGTRAP) { >+ siginfo_t si; >+ ptrace(PTRACE_GETSIGINFO, pid, (void*) 0, (void*) &si); >+//fprintf(stderr, "si_signo:%d\n" , si.si_signo); >+//fprintf(stderr, "si_errno:%d\n" , si.si_errno); >+//fprintf(stderr, "si_code:%d\n" , si.si_code); >+//fprintf(stderr, "si_pid:%d\n" , si.si_pid); >+//fprintf(stderr, "si_status:%d\n", si.si_status); >+//fprintf(stderr, "si_int:%d\n" , si.si_int); >+//fprintf(stderr, "si_ptr:%p\n" , si.si_ptr); >+//fprintf(stderr, "si_band:%ld\n" , (long)si.si_band); >+//I saw this: >+//false SIGTRAP real SIGTRAP >+//si_signo:64768 si_signo:5 /*SIGTRAP*/ >+//si_errno:0 si_errno:0 >+//si_code:6558744 si_code:128 /*SI_KERNEL*/ >+//si_pid:2 si_pid:0 >+//si_status:-1117706216 si_status:-1117706216 >+//si_int:-1117706216 si_int:-1117706216 >+//si_ptr:0x7fffbd612818 si_ptr:0x7fffbd612818 >+//si_band:2 si_band:0 >+ if (si.si_signo != SIGTRAP || si.si_code != SI_KERNEL) { >+ /* Set WSTOPSIG(status) = (SIGTRAP | 0x80) */ >+ status |= 0x8000; >+fprintf(stderr, "bogus SIGTRAP: made it SIGTRAP80\n"); >+ } >+ } >+ >+ if (WSTOPSIG(status) != SIGTRAP80) { > if (WSTOPSIG(status) == SIGSTOP && > (tcp->flags & TCB_SIGTRAPPED)) { > /*
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 162774
: 316309 |
317582
|
327158