From: Steve Dickson <SteveD@redhat.com>
To: linux-kernel <linux-kernel@vger.kernel.org>
Cc: NFS@lists.sourceforge.net
Subject: Re: [PATCH] repair nfsd/sunrpc in 2.6.14-rc2-mm1 (and other -mm versions)
Date: Thu, 22 Sep 2005 10:02:23 -0400 [thread overview]
Message-ID: <4332B96F.1040007@RedHat.com> (raw)
In-Reply-To: <mailman.1127394541.15384.linux-kernel2news@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 643 bytes --]
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.
[-- Attachment #2: 2.6.14-rc2-mm1-sunrpc-getports.patch --]
[-- Type: text/x-patch, Size: 996 bytes --]
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 <steved@redhat.com>
-------------------------
--- 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,
next parent reply other threads:[~2005-09-22 14:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.1127394541.15384.linux-kernel2news@redhat.com>
2005-09-22 14:02 ` Steve Dickson [this message]
2005-09-22 13:04 [PATCH] repair nfsd/sunrpc in 2.6.14-rc2-mm1 (and other -mm versions) Max Kellermann
2005-09-22 19:27 ` Andrew Morton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4332B96F.1040007@RedHat.com \
--to=steved@redhat.com \
--cc=NFS@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.