Bug 154182 - PTRACE_KILL acts like PTRACE_CONT after exec
PTRACE_KILL acts like PTRACE_CONT after exec
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
5
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Roland McGrath
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-04-07 20:56 EDT by Tom Horsley
Modified: 2007-11-30 17:11 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-10-30 23:50:45 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
The execbug.c source code to demonstrate the bug (4.08 KB, text/plain)
2005-04-07 20:58 EDT, Tom Horsley
no flags Details

  None (edit)
Description Tom Horsley 2005-04-07 20:56:08 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050323 Firefox/1.0.2 Fedora/1.0.2-1.3.1

Description of problem:
When you gain control of a process that just execed when running it
under ptrace with the PTRACE_SETOPTIONS PTRACE_O_TRACEEXEC flag turned on,
if the first thing you do to the process is send it a PTRACE_KILL,
instead of dying, it runs just as if you said PTRACE_CONT instead of KILL.

I will attach a test program to demo the bug. If you compile the program
with -DDOSTEP, it single steps 1 instruction first, then does the kill.
When you do that, the process actually dies.

I've been finding interesting bugs as I port my debugger to redhat, but
this is by far the weirdest :-).


Version-Release number of selected component (if applicable):
kernel-2.6.10-1.770_FC3

How reproducible:
Always

Steps to Reproduce:
1. gcc -o execbug -g execbug.c
2. ./execbug
  

Actual Results:  FAILED! I Didn't die!
ERR: Unexpected wait status: 0x200


Expected Results:  PASSED: The kid actually died as expected!


Additional info:
Comment 1 Tom Horsley 2005-04-07 20:58:43 EDT
Created attachment 112842 [details]
The execbug.c source code to demonstrate the bug
Comment 2 Dave Jones 2005-07-15 14:01:00 EDT
An update has been released for Fedora Core 3 (kernel-2.6.12-1.1372_FC3) which
may contain a fix for your problem.   Please update to this new kernel, and
report whether or not it fixes your problem.

If you have updated to Fedora Core 4 since this bug was opened, and the problem
still occurs with the latest updates for that release, please change the version
field of this bug to 'fc4'.

Thank you.
Comment 3 Tom Horsley 2005-07-16 20:34:11 EDT
Just tried this on my FC4 system with kernel 2.6.12-1.1390_FC4 and
it still fails the same way.
Comment 4 Tom Horsley 2005-07-16 20:52:15 EDT
I foolishly ran the tests without doing up2date first, but the even
newer kernel 2.6.12-1.1398_FC4 also still fails.
Comment 5 Dave Jones 2005-09-30 02:27:55 EDT
Mass update to all FC4 bugs:

An update has been released (2.6.13-1.1526_FC4) which rebases to a new upstream
kernel (2.6.13.2). As there were ~3500 changes upstream between this and the
previous kernel, it's possible your bug has been fixed already.

Please retest with this update, and update this bug if necessary.

Thanks.
Comment 6 Tom Horsley 2005-09-30 10:24:32 EDT
Just tried it with kernel 2.6.13-1.1526_FC4 and the test still fails.
Comment 7 Dave Jones 2005-11-10 14:27:14 EST
2.6.14-1.1637_FC4 has been released as an update for FC4.
Please retest with this update, as a large amount of code has been changed in
this release, which may have fixed your problem.

Thank you.
Comment 8 Tom Horsley 2005-11-11 07:50:59 EST
The bug still exists on the 1637 kernel.
Comment 9 Dave Jones 2006-02-03 00:30:53 EST
This is a mass-update to all currently open kernel bugs.

A new kernel update has been released (Version: 2.6.15-1.1830_FC4)
based upon a new upstream kernel release.

Please retest against this new kernel, as a large number of patches
go into each upstream release, possibly including changes that
may address this problem.

This bug has been placed in NEEDINFO_REPORTER state.
Due to the large volume of inactive bugs in bugzilla, if this bug is
still in this state in two weeks time, it will be closed.

Should this bug still be relevant after this period, the reporter
can reopen the bug at any time. Any other users on the Cc: list
of this bug can request that the bug be reopened by adding a
comment to the bug.

If this bug is a problem preventing you from installing the
release this version is filed against, please see bug 169613.

Thank you.
Comment 10 Tom Horsley 2006-02-03 08:17:02 EST
Nope, as expected, the bug still exists in kernel 2.6.15-1.1830_FC4.
Comment 11 Dave Jones 2006-09-16 22:02:08 EDT
[This comment added as part of a mass-update to all open FC4 kernel bugs]

FC4 has now transitioned to the Fedora legacy project, which will continue to
release security related updates for the kernel.  As this bug is not security
related, it is unlikely to be fixed in an update for FC4, and has been migrated
to FC5.

Please retest with Fedora Core 5.

Thank you.
Comment 12 Tom Horsley 2006-09-17 15:27:46 EDT
Just tried demo program on 2.6.17-1.2187_FC5smp in FC5 and it still
fails the same way. The bug is still there (and probably will be till
the whole ptrace subsystem is replaced :-).
Comment 13 Dave Jones 2006-10-16 14:06:09 EDT
A new kernel update has been released (Version: 2.6.18-1.2200.fc5)
based upon a new upstream kernel release.

Please retest against this new kernel, as a large number of patches
go into each upstream release, possibly including changes that
may address this problem.

This bug has been placed in NEEDINFO state.
Due to the large volume of inactive bugs in bugzilla, if this bug is
still in this state in two weeks time, it will be closed.

Should this bug still be relevant after this period, the reporter
can reopen the bug at any time. Any other users on the Cc: list
of this bug can request that the bug be reopened by adding a
comment to the bug.

In the last few updates, some users upgrading from FC4->FC5
have reported that installing a kernel update has left their
systems unbootable. If you have been affected by this problem
please check you only have one version of device-mapper & lvm2
installed.  See bug 207474 for further details.

If this bug is a problem preventing you from installing the
release this version is filed against, please see bug 169613.

If this bug has been fixed, but you are now experiencing a different
problem, please file a separate bug for the new problem.

Thank you.
Comment 14 Tom Horsley 2006-10-17 11:20:36 EDT
With kernel 2.6.18-1.2200.fc5smp, i686, this bug still exists.
Comment 15 Roland McGrath 2006-10-20 20:56:13 EDT
This is the upstream behavior and always has been.
PTRACE_KILL or PTRACE_CONT with a nonzero signal number only really works right
when at ptrace stop for a signal.  It sort of works, at least on some machines,
at ptrace stops for syscall tracing.  At other kinds of ptrace stops, the signal
is just dropped on the floor.

On all current kernels, just a normal kill with SIGKILL will work.
Comment 16 Roland McGrath 2006-10-30 23:50:45 EST
In fc6, I have replaced the whole ptrace subsystem.  But it's still compatible
with the behavior, including this.  The ptrace interface will always behave as
it did in the past.  In the near future there will be other options than ptrace.

Note You need to log in before you can comment on or make changes to this bug.