repair nfsd/sunrpc in 2.6.14-rc2-mm1 (and other -mm versions)
Subsystems (3)
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 5 lines · Max Kellermann
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 thexprt->resvportfield. 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.
-------------------------
net/sunrpc/pmap_clnt.c renamed from net/sunrpc/pmap_clnt.c.orig +2 -1
@@ -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 sockaif (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,