Subject: bin/36866: Memory exhaustion umounting a null filesystem
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: None <ilfoglionascosto@netcat.it>
List: netbsd-bugs
Date: 08/30/2007 11:25:00
>Number:         36866
>Category:       bin
>Synopsis:       Memory exhaustion umounting a null filesystem
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 30 11:25:00 +0000 2007
>Originator:     Claudio M.
>Release:        NetBSD 4.0_BETA2
>Organization:
NetBSD Italia
>Environment:
NetBSD develop.clanix.org 4.0_BETA2 NetBSD 4.0_BETA2 (GENERIC) #0: Thu Jul 26 16:26:55 PDT 2007  builds@wb30:/home/builds/ab/netbsd-4/i386/200707260002Z-obj/home/builds/ab/netbsd-4/src/sys/arch/i386/compile/GENERIC i386

>Description:
I've tried to play with the null filesystem by mounting /dev/null into a test directory.

 develop$ mkdir test ; sudo mount_null /dev/null test
 mount_null: "test" is a relative path.
 mount_null: using "/home/claudio/test" instead.

Indeed it has been mounted:

 develop$ mount |grep test ; file test
 /dev/null on /home/claudio/test type null (local)
 test: character special (2/2)

Now, trying to umount it (also with the -f flag) the umount command never exit and the system freeze due to the memory exhaustion. I have just few seconds to check if the test directory has been umounted:

 develop$ mount |grep test ; file test
 test: directory
 develop$

At this point i'm not able anymore to shutdown the system, kill the umount command or just type ls. I searched for the `-l' flag (lazy umount, as GNU ls) but it's not (yet?) implemented.

I hope to guessed the category (bin) since this seems to be an infinite loop somewhere in the umount code.

>How-To-Repeat:
Just mount /dev/null somewhere and umount it.
>Fix:
I'm not able to post any solution or workaround.