From: Ben Greear <greearb@candelatech.com>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH v3 4/6] nfs-utils: Support srcaddr=n option for string mount.
Date: Fri, 10 Jun 2011 15:30:10 -0700 [thread overview]
Message-ID: <4DF29AF2.6020508@candelatech.com> (raw)
In-Reply-To: <D9DC610C-5620-403C-BF0A-CCD37AFAF4BB@oracle.com>
On 06/10/2011 03:07 PM, Chuck Lever wrote:
>
> On Jun 10, 2011, at 5:08 PM, greearb@candelatech.com wrote:
>
>> From: Ben Greear<greearb@candelatech.com>
>>
>> Look for and parse the srcaddr=n argument. If parsing
>> succeeds, pass this down the call chain. This fully
>> implements binding to a specified source address when
>> mounting.
>> + if (!local_ip->is_set) {
>> + free(local_ip);
>> + return 0;
>> + }
>> + mi->local_ip = local_ip;
>> + }
>
> I'm wondering what kind of sanity checking is done on the srcaddr value.
>
> 1. Do we verify that srcaddr == clientaddr?
No, and I'm not sure we should. If they are specifying
both srcaddr and clientaddr, they are already in the rarely-used-options
category, so maybe they know what they are doing.
And, if it clientaddr is automatically figured out by
the kernel, then I think it must necessarily always be
srcaddr.
Makes me wonder though..could you do some sort of lame security
violation by making clientaddr some third-party IP?
>
> 2. Do we verify that srcaddr.sa_family == addr.sa_family ?
Not directly, but it will blow up in the bind() call if you
try it:
strace -f mount -t nfs [2002::100:157]:/rpool/ben /mnt/lf/znfs36-sol-1 -o srcaddr=192.168.100.117,vers=3
...
[pid 1488] munmap(0x7f0cd7b20000, 4096) = 0
[pid 1488] socket(PF_INET6, SOCK_STREAM, IPPROTO_TCP) = 3
[pid 1488] bind(3, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("192.168.100.117")}, 16) = -1 EINVAL (Invalid argument)
[root@ice-si-dmz fileio]# mount -t nfs [2002::100:157]:/rpool/ben /mnt/lf/znfs36-sol-1 -o srcaddr=192.168.100.117,vers=3
mount.nfs: an incorrect mount option was specified
That sufficient you think?
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
next prev parent reply other threads:[~2011-06-10 22:30 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-10 21:08 [PATCH v3 0/6] nfs-utils: Support binding to source address greearb
2011-06-10 21:08 ` [PATCH v3 1/6] nfs-utils: Add structure for passing local binding info greearb
2011-06-10 21:08 ` [PATCH v3 2/6] nfs-utils: Add patch to parse srcaddr= option greearb
2011-06-10 21:08 ` [PATCH v3 3/6] nfs-utils: Implement srcaddr binding in rpc_socket greearb
2011-06-10 22:06 ` Chuck Lever
2011-06-10 22:19 ` Ben Greear
2011-06-10 22:37 ` Chuck Lever
2011-06-10 22:50 ` Ben Greear
2011-06-10 21:08 ` [PATCH v3 4/6] nfs-utils: Support srcaddr=n option for string mount greearb
2011-06-10 22:07 ` Chuck Lever
2011-06-10 22:30 ` Ben Greear [this message]
2011-06-10 22:35 ` Chuck Lever
2011-06-13 20:37 ` Steve Dickson
2011-06-10 21:08 ` [PATCH v3 5/6] nfs-utils: Implement srcaddr=n binding for unmount greearb
2011-06-10 21:08 ` [PATCH v3 6/6] nfs-utils: Update man page for srcaddr= option greearb
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=4DF29AF2.6020508@candelatech.com \
--to=greearb@candelatech.com \
--cc=chuck.lever@oracle.com \
--cc=linux-nfs@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).