Linux NFS development
 help / color / mirror / Atom feed
* use of non-privileged ports for MNT and NLM
@ 2008-08-19 21:14 Chuck Lever
  2008-08-19 21:22 ` J. Bruce Fields
  2008-08-19 23:44 ` Trond Myklebust
  0 siblings, 2 replies; 3+ messages in thread
From: Chuck Lever @ 2008-08-19 21:14 UTC (permalink / raw)
  To: Trond Myklebust, Bruce Fields, Steve Dickson; +Cc: Linux NFS Mailing List

Working on "resvport" mount option.  Question occurred to me:

If I specify "noresvport" on a mount, can the client also use a non- 
privileged port for the initial MNT request, and can it use it for the  
NLM connection as well?

Question applies not just to Linux servers, but servers in general.   
Brief searching on teh internets does not reveal a quick answer.  I  
think rpc.mountd will allow a non-privileged port for "insecure"  
exports.

I think the answer is "yes, non-privileged ports can be used for MNT  
and NLM if the server explicitly allows it" but I thought I would open  
this up to the list.

-- 
Chuck Lever
chuck[dot]lever[at]oracle[dot]com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: use of non-privileged ports for MNT and NLM
  2008-08-19 21:14 use of non-privileged ports for MNT and NLM Chuck Lever
@ 2008-08-19 21:22 ` J. Bruce Fields
  2008-08-19 23:44 ` Trond Myklebust
  1 sibling, 0 replies; 3+ messages in thread
From: J. Bruce Fields @ 2008-08-19 21:22 UTC (permalink / raw)
  To: Chuck Lever; +Cc: Trond Myklebust, Steve Dickson, Linux NFS Mailing List

On Tue, Aug 19, 2008 at 05:14:54PM -0400, Chuck Lever wrote:
> Working on "resvport" mount option.  Question occurred to me:
>
> If I specify "noresvport" on a mount, can the client also use a non- 
> privileged port for the initial MNT request, and can it use it for the  
> NLM connection as well?
>
> Question applies not just to Linux servers, but servers in general.   
> Brief searching on teh internets does not reveal a quick answer.  I  
> think rpc.mountd will allow a non-privileged port for "insecure"  
> exports.

>From nfs-utils/utils/mountd/auth.c:auth_authenticate_internal():

	if (!(exp->m_export.e_flags & NFSEXP_INSECURE_PORT) &&
                    (ntohs(caller->sin_port) <  IPPORT_RESERVED/2 ||
                     ntohs(caller->sin_port) >= IPPORT_RESERVED)) {
                *error = illegal_port;
                return NULL;
        }

So assuming that function does what it name suggests, I think you're
right.

> I think the answer is "yes, non-privileged ports can be used for MNT and 
> NLM if the server explicitly allows it" but I thought I would open this 
> up to the list.

That's what I would have guessed.

And if the goal is to keep the number of reserved ports from being a
limit, it would be disappointing to eliminate only the ports used for
nfs itself.

--b.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: use of non-privileged ports for MNT and NLM
  2008-08-19 21:14 use of non-privileged ports for MNT and NLM Chuck Lever
  2008-08-19 21:22 ` J. Bruce Fields
@ 2008-08-19 23:44 ` Trond Myklebust
  1 sibling, 0 replies; 3+ messages in thread
From: Trond Myklebust @ 2008-08-19 23:44 UTC (permalink / raw)
  To: Chuck Lever; +Cc: Bruce Fields, Steve Dickson, Linux NFS Mailing List

On Tue, 2008-08-19 at 17:14 -0400, Chuck Lever wrote:
> Working on "resvport" mount option.  Question occurred to me:
> 
> If I specify "noresvport" on a mount, can the client also use a non- 
> privileged port for the initial MNT request, and can it use it for the  
> NLM connection as well?
> 
> Question applies not just to Linux servers, but servers in general.   
> Brief searching on teh internets does not reveal a quick answer.  I  
> think rpc.mountd will allow a non-privileged port for "insecure"  
> exports.
> 
> I think the answer is "yes, non-privileged ports can be used for MNT  
> and NLM if the server explicitly allows it" but I thought I would open  
> this up to the list.

How about a default that tries to connect using an insecure port first,
then falls back to a secure port if the attempt fails?

Cheers
  Trond

-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@netapp.com
www.netapp.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-08-19 23:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-19 21:14 use of non-privileged ports for MNT and NLM Chuck Lever
2008-08-19 21:22 ` J. Bruce Fields
2008-08-19 23:44 ` Trond Myklebust

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox