Bug 147940 - [nfs] mounting >1k TCP-NFS mounts fails
Summary: [nfs] mounting >1k TCP-NFS mounts fails
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 7.1-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-fs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-17 13:50 UTC by Robert Schulze
Modified: 2010-07-20 16:55 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Schulze 2010-06-17 13:50:03 UTC
Having >1k mountpoints in fstab, mount -a fails after the 212th mountpoint with the following message:

"RPCPROG_MNT: RPC: Authentication error; why = Client credential too weak"

All mountpoints are mounted with:

rw,soft,noatime,-N,-T,noinet6,-r=8192,-w=8192

Ommitting the -T flag and so using UDP mounts, everything is OK as long as -N is given, otherwise even UDP mounts fail. 

The Server is FreeBSD-8.0, exporting >1k ZFS mountpoints.
In /var/log/messages, there is the following hint

"mount request from XXXXX from unprivileged port"

As mountd(8) says, one may set vfs.nfsrv.nfs_privport to 0, but could that expose a security risk?

How-To-Repeat: create /etc/fstab with a large number of NFS mounts

$ mount -a
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2010-07-18 16:44:34 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-fs

Over to maintainer(s).
Comment 2 John Baldwin freebsd_committer freebsd_triage 2010-07-20 15:42:37 UTC
There are a limited number of privileged ports on a client, only 1k, and some 
of those ports are used for other services, so you certainly cannot mount 1k 
TCP NFS mounts unless you disable the privileged port check on the server.

nfs_privport=0 is not necessarily a risk if you trust all machines that are 
able to connect to your NFS server (e.g. you manage all the clients and the 
server is on a LAN or WAN and not directly connected to the Internet).  Even 
with nfs_privport=1 you are still trusting root on any client machines, 
nfs_privport=0 only prevents non-root users on client machines from 
establishing mounts.

However, this isn't a bug, this is just the way IP works, and as a result, the 
way that NFS mounts work.  -N for the UDP mounts is effectively similar to 
having nfs_privport set to 0.  I'm not sure exactly how it works (perhaps it 
requires the mount request to be privileged, but not the normal RPC traffic?), 
but that is why it is "working".

-- 
John Baldwin
Comment 3 John Baldwin freebsd_committer freebsd_triage 2010-07-20 16:55:25 UTC
State Changed
From-To: open->closed

This isn't a bug in the FreeBSD NFS client but a limit of IP.