NetBSD-Bugs archive

[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: Alan Barrett <apb%cequrux.com@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: kern/31507 (getcwd returns ERANGE after directory move across
 null mount)
Date: Tue, 3 May 2011 14:02:48 +0200

 On Sun, 01 May 2011, David Holland wrote:
 > 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:
 >
 >    mkdir /tmp/tree
 >    mkdir /tmp/tree/oak
 >    mkdir /tmp/tree/oak/leaf
 >    mkdir /tmp/null
 >    mount -t null /tmp/tree /tmp/null
 >    cd /tmp/null/oak/leaf
 >
 > then do:
 >
 >    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.
 
 mv(1) should allow that, and should implement it using copy and 
 delete.  rename(2) should not allow it.
 
 --apb (Alan Barrett)
 


Home | Main Index | Thread Index | Old Index