Subject: Re: kern/950: bad "mount" arguments cause panic
To: None <>
From: Chris G Demetriou <Chris_G_Demetriou@LAGAVULIN.PDL.CS.CMU.EDU>
List: netbsd-bugs
Date: 04/10/1995 18:48:53
> >Description:
> 	The problem has shown up after a mistake giving the arguments to
> "mount". The first parts of source and target were identical:
> mount zelnfs/... zelnfs   (Should be a nfs mount...)
> This causes: "panic: locking against myself".

i found this a while ago, i think more than a year ago.

> >How-To-Repeat:
> 	mkdir xxx
> 	mount xxx xxx

cute, eh?  8-)

> >Fix:
> 	One more parameter check?

Unfortunately, it's _not_ that easy.

in fact, what happens is that the mount code does a namei() on the
"device node" argument and on the "mount point" argument, and in the
process manages to try to "lock against itself."

The same bug exists in SunOS (4.1.?), ULTRIX (4.2, i think),  and a
bunch of other systems, though on at least the former, it simply hangs
the system, rather than panic'ing.  (i was surprised to note that it
_doesn't_ happen on DEC OSF/1, now a.k.a. DEC UNIX).

The fix is non-trivial, but i'm aware of people who are working on
things which are leading in the right direction.  8-)