Skip to contentSkip to conversation

direct mount from NFS-mounted directories issue

DISCUSSION Guillaume Rousse 2 participants 4 messages Mar 6, 2007 – Mar 8, 2007 Kernel automounter

lore
Share & tools
lore
#0 lore raw

A direct mount which mount point is itself located on a NFS mount does'nt work, with the following error message on launch:

Mar  6 14:05:21 stalingrad automount[23355]: do_mount_autofs_direct:

failed to create mount directory /home/members/rousse/test

From the mandriva user that reported this issue, it worked with previous release. Full story at http://qa.mandriva.com/show_bug.cgi?id=28646

maintainer
#1 lore raw
Quoted 4 lines · Guillaume Rousse

A direct mount which mount point is itself located on a NFS mount does'nt work, with the following error message on launch:

Mar  6 14:05:21 stalingrad automount[23355]: do_mount_autofs_direct:

failed to create mount directory /home/members/rousse/test

Does the mount point directory already exist within the remote NFS filesystem?

If not then create it.

This behavior was changed because the NFS client in recent kernels return EACCESS before it returned EEXIST. It would have been fine to just use stat(2) and then create the mount point directory but that attracted much criticism regarding the security aspects of "root" owned code to attempting to create directories on a remote NFS server. And so this is the way it is now.

Quoted 2 lines
Quoted 1 line

From the mandriva user that reported this issue, it worked with previous

release. Full story at http://qa.mandriva.com/show_bug.cgi?id=28646

Indeed it probably did work a little while ago.
Sorry for the inconvenience.

Ian

#2 lore raw
Quoted 6 lines · Ian Kent

This behavior was changed because the NFS client in recent kernels return EACCESS before it returned EEXIST. It would have been fine to just use stat(2) and then create the mount point directory but that attracted much criticism regarding the security aspects of "root" owned code to attempting to create directories on a remote NFS server. And so this is the way it is now.

I'm not a security expert, but it seems for me than allowing root owned code to create anything on the server is rather a question of configuring the export writability and trustability on root uid than enforcing it on client side. Anyway, could the client behaviour be configurable also, with current (secure) behaviour as default ?

maintainer
#3 lore raw
Quoted 7 lines · Guillaume Rousse
Quoted 6 lines · Ian Kent

This behavior was changed because the NFS client in recent kernels return EACCESS before it returned EEXIST. It would have been fine to just use stat(2) and then create the mount point directory but that attracted much criticism regarding the security aspects of "root" owned code to attempting to create directories on a remote NFS server. And so this is the way it is now.

Quoted 5 lines

I'm not a security expert, but it seems for me than allowing root owned code to create anything on the server is rather a question of configuring the export writability and trustability on root uid than enforcing it on client side. Anyway, could the client behaviour be configurable also, with current (secure) behaviour as default ?

Maybe but the criticism was that autofs was attempting to create remote directories "at all". Is it such a big ask that if mounts within remote filesystems have mount point directories already?

Ian