Skip to contentSkip to conversation

nfs: set vs_hidden on nfs4_callback_version4

PATCH In review Jeff Layton 3 participants 4 messages Sep 21, 2011 – Sep 22, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfs: set vs_hidden on nfs4_callback_version4

This service should not be registered with or unregistered from rpcbind.

---
 fs/nfs/callback_xdr.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
fs/nfs/callback_xdr.c +1 -0
index c6c86a7..7c8b800 100644
@@ -996,4 +996,5 @@ struct svc_version nfs4_callback_version4 = {
 	.vs_proc = nfs4_callback_procedures1,
 	.vs_xdrsize = NFS4_CALLBACK_XDRSIZE,
 	.vs_dispatch = NULL,
+	.vs_hidden = 1,
 };
Signature · 1 line
1.7.6.2
#1 lore raw
Quoted 1 line · Jeff Layton

This service should not be registered with or unregistered from rpcbind.

I've been watching the larger conversation. One thing that registering does, even if you don't want to advertise your service, is tell you if there is already another service on that port. Do we want to worry about possible port collisions for listeners like the callback service?

Do we want to ensure that any other service on that port is unregistered? We would already discover a listener on our port when trying to create the socket, but an old registration may persist even after that old service has gone away.

This is something to think about when revisiting the semantics of .vs_hidden.

Quoted 22 lines

---
fs/nfs/callback_xdr.c | 1 +

1 files changed, 1 insertions(+), 0 deletions(-)
fs/nfs/callback_xdr.c +1 -0
index c6c86a7..7c8b800 100644
@@ -996,4 +996,5 @@ struct svc_version nfs4_callback_version4 = {
 	.vs_proc = nfs4_callback_procedures1,
 	.vs_xdrsize = NFS4_CALLBACK_XDRSIZE,
 	.vs_dispatch = NULL,
+	.vs_hidden = 1,
 };
Signature · 6 lines
1.7.6.2

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Chuck Lever
chuck[dot]lever[at]oracle[dot]com
#2 lore raw
Quoted 5 lines

-----Original Message-----
From: Chuck Lever [mailto:[email protected]]
Sent: Wednesday, September 21, 2011 4:06 PM
To: Jeff Layton
Cc: Myklebust, Trond; [email protected];

[email protected]

Quoted 6 lines

Subject: Re: [PATCH] nfs: set vs_hidden on nfs4_callback_version4

Quoted 1 line · Jeff Layton

This service should not be registered with or unregistered from

rpcbind.

Quoted 2 lines

I've been watching the larger conversation. One thing that

registering does,

Quoted 1 line

even if you don't want to advertise your service, is tell you if there

is already

Quoted 2 lines

another service on that port. Do we want to worry about possible port collisions for listeners like the callback service?

We already have a module parameter for fixing the callback service so that we can avoid port collisions with known services. That said, normally we do not want to rely on the portmapper for detecting the existence of a service: that will in any case only detect RPC services and, as you point out below, is subject to stale entries.

Quoted 1 line

Do we want to ensure that any other service on that port is

unregistered?

Quoted 1 line

We would already discover a listener on our port when trying to create

the

Quoted 1 line

socket, but an old registration may persist even after that old

service has

Quoted 1 line

gone away.

If anyone tries to use the service which is advertised by the stale portmapper entry, then they will get a PROG_UNAVAIL error.

Cheers
Trond

#3 lore raw
Quoted 18 lines · Trond
Quoted 5 lines

-----Original Message-----
From: Chuck Lever [mailto:[email protected]]
Sent: Wednesday, September 21, 2011 4:06 PM
To: Jeff Layton
Cc: Myklebust, Trond; [email protected];

[email protected]

Quoted 6 lines

Subject: Re: [PATCH] nfs: set vs_hidden on nfs4_callback_version4

Quoted 1 line · Jeff Layton

This service should not be registered with or unregistered from

rpcbind.

Quoted 2 lines

I've been watching the larger conversation. One thing that

registering does,

Quoted 1 line

even if you don't want to advertise your service, is tell you if there

is already

Quoted 9 lines
Quoted 2 lines

another service on that port. Do we want to worry about possible port collisions for listeners like the callback service?

We already have a module parameter for fixing the callback service so that we can avoid port collisions with known services. That said, normally we do not want to rely on the portmapper for detecting the existence of a service: that will in any case only detect RPC services and, as you point out below, is subject to stale entries.

Doing so also seems like a potential DoS vector. Just register every reserved port you can get your hands on and enjoy the show...

Quoted 11 lines
Quoted 1 line

Do we want to ensure that any other service on that port is

unregistered?

Quoted 1 line

We would already discover a listener on our port when trying to create

the

Quoted 1 line

socket, but an old registration may persist even after that old

service has

Quoted 1 line

gone away.

If anyone tries to use the service which is advertised by the stale portmapper entry, then they will get a PROG_UNAVAIL error.

We should also point out that other non-RPC based services in the kernel do not deal with the portmapper at all. I don't see any harm from unregistering these ports from the portmapper on service creation, but I'm not sure it really provides much benefit.

In any case though, I didn't think the rpcbind protocol really gave you the ability to unregister based on the just the port -- you have to do it by program number. In order to do this, we'd need to poll for the entire list of registered services and unregister any that have matching ports. That sounds ugly to implement :-/

Signature · 1 line
Jeff Layton <[email protected]>