recursively call shell script will freeze whole system

Bug #1179818 reported by qinghao
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
bash (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

run the following script will freeze the whole system. i made some mistakes when i write it.
but such a bad script should not freeze the whole system.

<code>
if test $# -gt t ;
then
echo 1;
else
    `basename $0` \<url\> \[new_filename\]
fi
</code>

it's not the first time that recursively call to script freeze the system.
i didn't remember what i have run the last time. but the results are the same.

the system became no responding to keyboard and mouse.
screen and windows content not update any more.

i confirmed the SSH and CTRL+ALT+F# this time. both of them stuck or 60s timeout-ed.
Ubuntu version: 12.04.1 amd64 server
Linux kernel version: 3.2.0-29-generic #46-Ubuntu SMP Fri Jul 27 17:03:23 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
bash: 4.2-2ubuntu2
coreutils: 8.13-3ubuntu3

i have confirmed this bug is vm (virtualbox) running the same version ubuntu, it froze too.
it will not terminate itself. your can cancel it will CTRL+C at the beginning seconds.
after running for longer time it become not cancel-able and not accept the key input.

i have tried another box running Fedora 15[1] , it has no such problem. and can be
canceled by CTRL+C . after running for longer time it will quit itself.
fedora version:Fedora 15 i686
Linux version:
2.6.38.6-26.rc1.fc15.i686 #1 SMP Mon May 9 20:43:14 UTC 2011 i686 i686 i386 GNU/Linux
bash-4.2.10-4.fc15.i686
coreutils-8.10-2.fc15.i686

Tags: freeze shell
affects: launchpad → ubuntu-ubuntu-server
affects: ubuntu-ubuntu-server → gnubash
affects: gnubash → bash (Ubuntu)
Revision history for this message
Matthias Klose (doko) wrote :

sorry, can't protect against pebkac issues.

Changed in bash (Ubuntu):
status: New → Invalid
Revision history for this message
qinghao (qinghao1-deactivatedaccount) wrote :

ok, pebkac issue.
but it can freeze the whole system, make it responsible-less.
a regular user can freeze the whole system by run a script in his own shell.

i think this could be a big security hole.

Revision history for this message
qinghao (qinghao1-deactivatedaccount) wrote :

more annoying, confirmed on another installation of ubuntu 9.04, same result.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.