Bug 144255 - forked nash process continue after failing execve
forked nash process continue after failing execve
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: mkinitrd (Show other bugs)
8
All Linux
medium Severity medium
: ---
: ---
Assigned To: Peter Jones
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-01-05 07:59 EST by Kasper Dupont
Modified: 2009-01-09 01:51 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-01-09 01:51:47 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)
One-liner that appears to solve the problem. (429 bytes, patch)
2005-01-05 08:00 EST, Kasper Dupont
no flags Details | Diff

  None (edit)
Description Kasper Dupont 2005-01-05 07:59:28 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3)
Gecko/20040922

Description of problem:
When nash needs to execute an external command a new process is
forked. If the execve call fails this child will execute the rest of
the script. This cause the rest of the script to be executed twice.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Run this script:

#!/sbin/nash --force
/foo/bar
echo hello


Actual Results:
(forcing normal run)
Red Hat nash version 3.5.22 starting
ERROR: failed in exec of /foo/bar
hello
hello


Expected Results:
(forcing normal run)
Red Hat nash version 3.5.22 starting
ERROR: failed in exec of /foo/bar
hello


Additional info:
Comment 1 Kasper Dupont 2005-01-05 08:00:48 EST
Created attachment 109361 [details]
One-liner that appears to solve the problem.
Comment 2 Matthew Miller 2005-04-26 11:25:02 EDT
Fedora Core 2 is now maintained by the Fedora Legacy project for
security updates only. If this problem is a security issue, please
reopen and reassign to the Fedora Legacy product. If it is not a
security issue and hasn't been resolved in the current FC3 updates or
in the FC4 test release, reopen and change the version to match.
Comment 3 Kasper Dupont 2005-09-30 07:38:47 EDT
This problem also exist in FC3 with mkinitrd-4.1.18-2, FC3 with
mkinitrd-4.2.7-1, and FC4 with mkinitrd-4.2.15-1.
Comment 4 Matthew Miller 2006-07-07 13:43:34 EDT
Reassigning to FC4 as per comment #3. Kasper, can you also test with FC5 and
FC6test, if you have a few moments? Sorry I didn't notice your message last year.
Comment 5 Kasper Dupont 2006-08-15 15:38:31 EDT
With mkinitrd-5.0.32-1 the problem cannot be reproduced by specifying a
nonexisting executable. It looks like these two lines are intended to catch a
bad executable being specified. But for some reason I don't see the error message:

    if (access(bin, X_OK)) {
        eprintf("failed to execute %s: %m\n", bin);
        return 1;
    }

However the actual code around the execve call still contains the original bug,
so in the event that access say it is OK, but execve fails, the bug can still be
triggered. I think my earlier patch to fix the problem still applies.

The problem can be reproduced with a file marked executable, but not in a proper
executable format. Create /tmp/foobar with this command and execute the
following script:

chmod 755 /tmp/foobar >/tmp/foobar

#!/sbin/nash --force
/tmp/foobar
echo hello

I get the following output:
(forcing normal run)
Red Hat nash version 5.0.32 starting
ERROR: failed in exec of /tmp/foobar: Exec format error
hello
hello
Comment 6 petrosyan 2008-03-10 01:41:42 EDT
Fedora Core 5 is no longer maintained. Is this bug still present in Fedora 8?
Comment 7 Kasper Dupont 2008-03-10 03:58:16 EDT
The bug can be reproduced in Fedora 8 with the exact same steps as in 5.
Comment 8 Bug Zapper 2008-11-26 01:48:36 EST
This message is a reminder that Fedora 8 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 8.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '8'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 8's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 8 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 9 Bug Zapper 2009-01-09 01:51:47 EST
Fedora 8 changed to end-of-life (EOL) status on 2009-01-07. Fedora 8 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

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