2006-07-07 17:42:13

by Amit Gud

[permalink] [raw]
Subject: [PATCH] Fix NFS mount options in mount.nfs

_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs


Attachments:
fix-mount-options.patch (9.19 kB)
(No filename) (299.00 B)
(No filename) (140.00 B)
Download all attachments

2006-07-07 20:50:30

by Amit Gud

[permalink] [raw]
Subject: Re: [PATCH] Fix NFS mount options in mount.nfs

Steinar H. Gunderson wrote:
> On Fri, Jul 07, 2006 at 03:47:00PM -0400, Amit Gud wrote:
>> Please use the attached patch for testing. It varies only in the above
>> portion, but that should make a difference.
>
> Say, why is mount.nfs suid root in the first place? I'd expect it only to be
> called by mount, which should be suid already...
>

For security reasons, mount command resets the uids before calling
mount.nfs. So, even mount.nfs needs to be suid root to be able to use
the 'user' and 'users' mount options for NFS.


AG
--
May the source be with you.
http://www.cis.ksu.edu/~gud


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2006-07-08 18:56:41

by Chuck Lever

[permalink] [raw]
Subject: Re: [PATCH] Fix NFS mount options in mount.nfs

On 7/7/06, Amit Gud <[email protected]> wrote:
> Steinar H. Gunderson wrote:
> > Thanks, that should clean up most of the problems. How well is this tested?
> >
>
> The problem was the options that are meant solely for the mount utility,
> like remount or noauto, were being passed further down to the syscall.
> These options should be handled within the mount utility only and should
> not be passed further.
>
> I tested with options like
> noauto,async,_netdev,nodiratime,users,dirsync,noatime,nodev,mand,group,owner,suid,user,exec,rw,soft,intr
> and it apparently worked OK. This isn't regressively tested though. I
> would like to see this patch tested in the environment mentioned in
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=376839 .

How does this change affect the mount options that show up in
/proc/mounts and /proc/self/mountstats?

--
"We who cut mere stones must always be envisioning cathedrals"
-- Quarry worker's creed

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2006-07-08 19:08:40

by Amit Gud

[permalink] [raw]
Subject: Re: [PATCH] Fix NFS mount options in mount.nfs

Chuck Lever wrote:
>
> How does this change affect the mount options that show up in
> /proc/mounts and /proc/self/mountstats?

IMO, it wouldn't affect at all. We are just trying to change the
user-space binaries, the stuff going in the kernel is still the same.


AG--
May the source be with you.
http://www.cis.ksu.edu/~gud


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2006-07-07 17:46:49

by Steinar H. Gunderson

[permalink] [raw]
Subject: Re: [PATCH] Fix NFS mount options in mount.nfs

Thanks, that should clean up most of the problems. How well is this tested?

/* Steinar */
--
Homepage: http://www.sesse.net/

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2006-07-07 17:59:58

by Amit Gud

[permalink] [raw]
Subject: Re: [PATCH] Fix NFS mount options in mount.nfs

Steinar H. Gunderson wrote:
> Thanks, that should clean up most of the problems. How well is this tested?
>

The problem was the options that are meant solely for the mount utility,
like remount or noauto, were being passed further down to the syscall.
These options should be handled within the mount utility only and should
not be passed further.

I tested with options like
noauto,async,_netdev,nodiratime,users,dirsync,noatime,nodev,mand,group,owner,suid,user,exec,rw,soft,intr
and it apparently worked OK. This isn't regressively tested though. I
would like to see this patch tested in the environment mentioned in
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=376839 .


AG
--
May the source be with you.
http://www.cis.ksu.edu/~gud


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2006-07-07 18:32:55

by Steinar H. Gunderson

[permalink] [raw]
Subject: Re: [PATCH] Fix NFS mount options in mount.nfs

On Fri, Jul 07, 2006 at 02:03:42PM -0400, Amit Gud wrote:
> I tested with options like
> noauto,async,_netdev,nodiratime,users,dirsync,noatime,nodev,mand,group,owner,suid,user,exec,rw,soft,intr
> and it apparently worked OK. This isn't regressively tested though. I would
> like to see this patch tested in the environment mentioned in
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=376839 .

I'll make an upload to Debian; the current state is quite broken anyhow, so I
guess it can't hurt. :-)

/* Steinar */
--
Homepage: http://www.sesse.net/

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2006-07-07 18:41:11

by Steinar H. Gunderson

[permalink] [raw]
Subject: Re: [PATCH] Fix NFS mount options in mount.nfs

FWIW, this part is wrong:

> install-exec-hook:
> (cd $(DESTDIR)$(sbindir) && \
> - ln -sf $(sbin_PROGRAMS) mount.nfs4 && \
> - ln -sf $(sbin_PROGRAMS) umount.nfs && \
> - ln -sf $(sbin_PROGRAMS) umount.nfs4)
> + chmod +s $(sbin_PROGRAMS) && \
> + cp $(sbin_PROGRAMS) /sbin/mount.nfs4 && \
> + cp $(sbin_PROGRAMS) /sbin/umount.nfs && \
> + cp $(sbin_PROGRAMS) /sbin/umount.nfs4)

You cannot expect to be able to put stuff directly into /sbin, you'll have to
heed $(DESTDIR).

/* Steinar */
--
Homepage: http://www.sesse.net/

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2006-07-07 20:33:27

by Steinar H. Gunderson

[permalink] [raw]
Subject: Re: [PATCH] Fix NFS mount options in mount.nfs

On Fri, Jul 07, 2006 at 03:47:00PM -0400, Amit Gud wrote:
> Please use the attached patch for testing. It varies only in the above
> portion, but that should make a difference.

Say, why is mount.nfs suid root in the first place? I'd expect it only to be
called by mount, which should be suid already...

/* Steinar */
--
Homepage: http://www.sesse.net/

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs