Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 459786

Summary: utrace signal handling bug interferes with systemtap uprobes
Product: Red Hat Enterprise Linux 5 Reporter: Frank Ch. Eigler <fche>
Component: kernelAssignee: Roland McGrath <roland>
Status: CLOSED ERRATA QA Contact: Martin Jenner <mjenner>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.3   
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-01-20 20:19:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Frank Ch. Eigler 2008-08-22 11:23:38 UTC
The utrace patches bound for RHEL5.3 have a bug related to
disruption of signal handlers of user-space programs when
a user-space systemtap probe is active.

See http://sourceware.org/bugzilla/show_bug.cgi?id=6828
See also bug #309551.

Roland and others are already testing a patch.  Apparently
this only affects "non-ptrace users of utrace", which is
namely systemtap.

Comment 1 Frank Ch. Eigler 2008-08-22 13:41:11 UTC
Roland's patch was successfully tested as a part of 2.6.18-105.el5.stap6828.

Comment 2 Frank Ch. Eigler 2008-08-22 18:10:21 UTC
For reference, here's roland's patch:

diff --git a/kernel/utrace.c b/kernel/utrace.c
index 5083288..0000000 100644
--- a/kernel/utrace.c
+++ b/kernel/utrace.c
@@ -2108,8 +2108,15 @@ utrace_get_signal(struct task_struct *ts
                 * The handler will run.  We do the SA_ONESHOT work here
                 * since the normal path will only touch *return_ka now.
                 */
-               if (return_ka->sa.sa_flags & SA_ONESHOT)
-                       ka->sa.sa_handler = SIG_DFL;
+               signal.signr = info->si_signo;
+               if (likely(signal.signr) &&
+                   unlikely(return_ka->sa.sa_flags & SA_ONESHOT)) {
+                       return_ka->sa.sa_flags &= ~SA_ONESHOT;
+                       if (likely(valid_signal(signal.signr))) {
+                               ka = &tsk->sighand->action[signal.signr - 1];
+                               ka->sa.sa_handler = SIG_DFL;
+                       }
+               }
                break;

        case UTRACE_SIGNAL_TSTP:

Comment 3 Don Zickus 2008-09-05 20:07:00 UTC
in kernel-2.6.18-108.el5
You can download this test kernel from http://people.redhat.com/dzickus/el5

Comment 7 errata-xmlrpc 2009-01-20 20:19:11 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2009-0225.html