Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
Calling a subshell within a script started by exec can cause the exec'ed script to call itself indefinitely, much like a fork bomb.
Note: be careful with the test case, as it may make your system unstable.
Version-Release number of selected component (if applicable):
ksh-20100621-5.el5
How reproducible:
100% of the time
Steps to Reproduce:
1. Create an executable file "foo" with the following two strings:
$ cat /root/foo
vi /tmp/bar
# Comment needed to trigger the bomb
2. Start a KSH session and exec the foo script:
$ ksh
$ exec /root/foo
3. You are now in a VI session. Send the TSTP signal to VI using CTRL-Z, close VI using :q.
Actual results:
/root/foo spawns itself as a child until it hits the nproc limit and is unable to fork any more processes.
Expected results:
The VI session drops to the background and can be recalled using "fg".
Additional info:
Unable to reproduce using bash. Still reproduces using the updated KSH RPM's from bug https://bugzilla.redhat.com/show_bug.cgi?id=892206
Reproduces in RHEL6 as well:
$ ksh --version
version sh (AT&T Research) 93t+ 2010-06-21
$ rpm -qa |grep ksh
ksh-20100621-19.el6.x86_64
On RHEL6 the script sometimes gives a Memory fault without spawning unlimited childs:
$ exec /root/foo
/root/foo: line 1: 0:
/root/foo: line 1: 2396: Memory fault
There is already another ksh fork bomb bug reported for RHEL5 - bug #910923
Instead of closing this as a duplicate, I'll use it for tracking this bug in RHEL6
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
http://rhn.redhat.com/errata/RHBA-2013-1599.html