Re: [PATCH] repair nfsd/sunrpc in 2.6.14-rc2-mm1 (and other -mm versions)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Max Kellermann wrote:
Your -mm patches make the sunrpc client connect to the portmapper with
a non-privileged source port.  This is due to a change in
net/sunrpc/pmap_clnt.c, which manually resets the xprt->resvport
field.  My tiny patch removes this line.  I have no idea why the line
was added in the first place, does somebody know better?
Yes this is a bug, since most Linux portmapper will not
allow ports to be set or unset using non-privilege ports.
But non-privilege ports can be used to get ports information.
So I would suggest the following patch that stops the
use of privileges ports on only get port requests.

steved.
Privilege ports are need for services to set and unset ports, but
are not needed to get ports. This patch eliminates the use of
privilege ports for PMAP_GETPORT rpcs and restores the use
of privilege ports for PMAP_SET  and  PMAP_UNSET rpcs.

Signed-off-by: Steve Dickson <[email protected]>

-------------------------
--- 2.6.14-rc2-mm1/net/sunrpc/pmap_clnt.c.orig	2005-09-22 09:42:28.394681000 -0400
+++ 2.6.14-rc2-mm1/net/sunrpc/pmap_clnt.c	2005-09-22 09:52:51.777617000 -0400
@@ -70,6 +70,8 @@ rpc_getport(struct rpc_task *task, struc
 		task->tk_status = PTR_ERR(pmap_clnt);
 		goto bailout;
 	}
+	/* Don't need reserved ports to get ports from portmappers */
+	pmap_clnt->cl_xprt->resvport = 0;
 	task->tk_status = 0;
 
 	/*
@@ -208,7 +210,6 @@ pmap_create(char *hostname, struct socka
 	if (IS_ERR(xprt))
 		return (struct rpc_clnt *)xprt;
 	xprt->addr.sin_port = htons(RPC_PMAP_PORT);
-	xprt->resvport = 0;
 
 	/* printk("pmap: create clnt\n"); */
 	clnt = rpc_new_client(xprt, hostname,

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux