[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: kern/31507 (getcwd returns ERANGE after directory move across null mount)
The following reply was made to PR kern/31507; it has been noted by GNATS.
From: David Holland <dholland-bugs%netbsd.org@localhost>
Subject: Re: kern/31507 (getcwd returns ERANGE after directory move across
Date: Sun, 1 May 2011 01:40:43 +0000
On Sun, May 01, 2011 at 12:35:40AM +0000, dholland%NetBSD.org@localhost wrote:
> No answer to my question. But, without knowing what FS was under the null
> mount, it's hard to know what steps to take. FFS in -4 should yield EXDEV
> in this case... or so I believe anyway, but I might be wrong...
Nope, I'm wrong. It appears that because the EXDEV checks are under
the VFS interface, and because layer_bypass is too permissive, you can
set up like this:
mount -t null /tmp/tree /tmp/null
mv /tmp/null/oak/leaf /tmp/tree/
and it will succeed. This doesn't crash -current, even if the moved
directory is your working directory; it leaves you in the same state
as if your working directory is rmdir'd under you.
However, it ought not to be allowed.
There is no legitimate reason to allow operations like this, so I'm
highly inclined to add cross-device checks to do_sys_rename (like
rmind recently did for link) and then pull them up to -4 and -5.
David A. Holland
Main Index |
Thread Index |