]> git.baikalelectronics.ru Git - kernel.git/commit
nfsd: fix EXDEV checking in rename
authorJ. Bruce Fields <bfields@redhat.com>
Mon, 15 Apr 2013 20:03:46 +0000 (16:03 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Fri, 26 Apr 2013 20:18:15 +0000 (16:18 -0400)
commitc58c79f2e47084bdd4a8276d4230f35d83f0f6b8
treeab9ec0cbd2636e3089db7a10ec49756cce702820
parentd2e746f87f2c74ee17f36db22d2904d88cab8ea4
nfsd: fix EXDEV checking in rename

We again check for the EXDEV a little later on, so the first check is
redundant.  This check is also slightly racier, since a badly timed
eviction from the export cache could leave us with the two fh_export
pointers pointing to two different cache entries which each refer to the
same underlying export.

It's better to compare vfsmounts as the later check does, but that
leaves a minor security hole in the case where the two exports refer to
two different directories especially if (for example) they have
different root-squashing options.

So, compare ex_path.dentry too.

Reported-by: Joe Habermann <joe.habermann@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/vfs.c