aboutsummaryrefslogtreecommitdiff
path: root/sys/nfsserver/nfs_srvkrpc.c
Commit message (Collapse)AuthorAgeFilesLines
* - Move nfs_realign() from the NFS client to the shared NFS code andMarius Strobl2010-02-091-58/+1
| | | | | | | | | | | | | | | | | | | | remove the NFS server version in order to reduce code duplication. The shared version now uses a second parameter how, which is passed on to m_get(9) and m_getcl(9) as the server used M_WAIT while the client requires M_DONTWAIT, and replaces the the previously unused parameter hsiz. - Change nfs_realign() to use nfsm_aligned() so as with other NFS code the alignment check isn't actually performed on platforms without strict alignment requirements for performance reasons because as the comment suggests unaligned data only occasionally occurs with TCP. - Change fha_extract_info() to use nfs_realign() with M_DONTWAIT rather than M_WAIT because it's called with the RPC sp_lock held. Reviewed by: jhb, rmacklem MFC after: 1 week Notes: svn path=/head/; revision=203732
* Some style(9) fixes in order to fabricate a commit to denote thatMarius Strobl2010-01-091-13/+11
| | | | | | | | | | | | | | | the commit message for r201896 actually should have read: As nfsm_srvmtofh_xx() assumes the 4-byte alignment required by XDR ensure the mbuf data is aligned accordingly by calling nfs_realign() in fha_extract_info(). This fix is orthogonal to the problem solved by r199274/r199284. PR: 142102 (second part) MFC after: 1 week Notes: svn path=/head/; revision=201899
* Exclude options COMPAT_FREEBSD4 now that the MD freebsd4_sigreturn()Marius Strobl2010-01-091-1/+1
| | | | | | | | | | | is gone since r201396 and which is also in line with the fact that FreeBSD 4 didn't supported sparc64. PR: 142102 (second part) MFC after: 1 week Notes: svn path=/head/; revision=201896
* Remove the old kernel RPC implementation and the NFS_LEGACYRPC option.Doug Rabson2009-06-301-5/+0
| | | | | | | Approved by: re Notes: svn path=/head/; revision=195202
* Since svc_[dg|vc|tli|tp]_create() did not hold a reference count on theRick Macklem2009-06-171-0/+1
| | | | | | | | | | | | | | | | SVCXPTR structure returned by them, it was possible for the structure to be free'd before svc_reg() had been completed using the structure. This patch acquires a reference count on the newly created structure that is returned by svc_[dg|vc|tli|tp]_create(). It also adds the appropriate SVC_RELEASE() calls to the callers, except the experimental nfs subsystem. The latter will be committed separately. Submitted by: dfr Tested by: pho Approved by: kib (mentor) Notes: svn path=/head/; revision=194407
* Add a #include <sys/jail.h> so that it builds whenRick Macklem2009-06-121-0/+1
| | | | | | | | | options KGSSAPI is specified in the kernel configuration. Approved by: kib (mentor) Notes: svn path=/head/; revision=194073
* Move "options MAC" from opt_mac.h to opt_global.h, as it's now in GENERICRobert Watson2009-06-051-0/+2
| | | | | | | | | | | and used in a large number of files, but also because an increasing number of incorrect uses of MAC calls were sneaking in due to copy-and-paste of MAC-aware code without the associated opt_mac.h include. Discussed with: pjd Notes: svn path=/head/; revision=193511
* Place hostnames and similar information fully under the prison system.Jamie Gritton2009-05-291-2/+3
| | | | | | | | | | | | | | | | | | | | The system hostname is now stored in prison0, and the global variable "hostname" has been removed, as has the hostname_mtx mutex. Jails may have their own host information, or they may inherit it from the parent/system. The proper way to read the hostname is via getcredhostname(), which will copy either the hostname associated with the passed cred, or the system hostname if you pass NULL. The system hostname can still be accessed directly (and without locking) at prison0.pr_host, but that should be avoided where possible. The "similar information" referred to is domainname, hostid, and hostuuid, which have also become prison parameters and had their associated global variables removed. Approved by: bz (mentor) Notes: svn path=/head/; revision=193066
* Fix build of KGSSAPI bits post-vimage.Doug Rabson2009-05-241-1/+2
| | | | Notes: svn path=/head/; revision=192678
* Change nfsserver so that it uses the nfssvc() system call providedRick Macklem2009-04-121-14/+4
| | | | | | | | | | | | | | in sys/nfs/nfs_nfssvc.c by registering with it using the nfsd_call_nfsserver function pointer. Also, add the build glue for nfs_nfssvc.c optionally based on "nfsserver" and also as a loadable module. Submitted by: rmacklem Reviewed by: kib Approved by: kib (mentor) Notes: svn path=/head/; revision=190971
* Fix an mbuf leak in the error path.Doug Rabson2009-03-191-0/+2
| | | | | | | Submitted by: Rick Macklem <rick at snowhite dot cis dot uoguelph dot ca> Notes: svn path=/head/; revision=190053
* Use the remote address for access control, not the local address. This fixesDoug Rabson2008-11-131-2/+44
| | | | | | | | | | | the nfsd problems that some people have with the new code. Add support for the vfs.nfsrv.nfs_privport sysctl which denies access unless the client is using a port number less than 1024. Not really sure if this is particularly useful since it doesn't add any real security. Notes: svn path=/head/; revision=184921
* Turn (NFSERR_AUTHERR|code) status values into svcerr_auth(rqst, code) repliesDoug Rabson2008-11-121-2/+7
| | | | | | | instead of returning a success with a bogus NFS error code. Notes: svn path=/head/; revision=184869
* Include <sys/eventhandler.h>.Doug Rabson2008-11-041-0/+1
| | | | Notes: svn path=/head/; revision=184643
* Implement support for RPCSEC_GSS authentication to both the NFS clientDoug Rabson2008-11-031-0/+565
and server. This replaces the RPC implementation of the NFS client and server with the newer RPC implementation originally developed (actually ported from the userland sunrpc code) to support the NFS Lock Manager. I have tested this code extensively and I believe it is stable and that performance is at least equal to the legacy RPC implementation. The NFS code currently contains support for both the new RPC implementation and the older legacy implementation inherited from the original NFS codebase. The default is to use the new implementation - add the NFS_LEGACYRPC option to fall back to the old code. When I merge this support back to RELENG_7, I will probably change this so that users have to 'opt in' to get the new code. To use RPCSEC_GSS on either client or server, you must build a kernel which includes the KGSSAPI option and the crypto device. On the userland side, you must build at least a new libc, mountd, mount_nfs and gssd. You must install new versions of /etc/rc.d/gssd and /etc/rc.d/nfsd and add 'gssd_enable=YES' to /etc/rc.conf. As long as gssd is running, you should be able to mount an NFS filesystem from a server that requires RPCSEC_GSS authentication. The mount itself can happen without any kerberos credentials but all access to the filesystem will be denied unless the accessing user has a valid ticket file in the standard place (/tmp/krb5cc_<uid>). There is currently no support for situations where the ticket file is in a different place, such as when the user logged in via SSH and has delegated credentials from that login. This restriction is also present in Solaris and Linux. In theory, we could improve this in future, possibly using Brooks Davis' implementation of variant symlinks. Supporting RPCSEC_GSS on a server is nearly as simple. You must create service creds for the server in the form 'nfs/<fqdn>@<REALM>' and install them in /etc/krb5.keytab. The standard heimdal utility ktutil makes this fairly easy. After the service creds have been created, you can add a '-sec=krb5' option to /etc/exports and restart both mountd and nfsd. The only other difference an administrator should notice is that nfsd doesn't fork to create service threads any more. In normal operation, there will be two nfsd processes, one in userland waiting for TCP connections and one in the kernel handling requests. The latter process will create as many kthreads as required - these should be visible via 'top -H'. The code has some support for varying the number of service threads according to load but initially at least, nfsd uses a fixed number of threads according to the value supplied to its '-n' option. Sponsored by: Isilon Systems MFC after: 1 month Notes: svn path=/head/; revision=184588