aboutsummaryrefslogtreecommitdiff
path: root/sys/rpc/rpcsec_gss
Commit message (Collapse)AuthorAgeFilesLines
* rpcsec_gss: Rename KRBIMP_HESIOD1 to KRBIMP_HEIMDALV1Rick Macklem2025-08-093-3/+3
| | | | | | | | | | | This was a weird brain fart. Long ago I used a directory service called Hesiod, which was written by MIT. For some inexplicable reason, I used that name instead of Heimdal. This patch replaces the name with a Heimdal one. Suggested by: bjk Fixes: e3ac01e18eb3 ("kgssapi: Fix the kgssapi so that it can use MIT Kerberos")
* kgssapi: Fix the kgssapi so that it can use MIT KerberosRick Macklem2025-08-073-42/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without this patch, the kgssapi uses detailed knowledge of the internal context structure for Heimdal (up to vers 1.5). It also does four upcalls to the gssd daemon to establish a server side RPCSEC_GSS context. This patch adds support for three new upcalls: gss_init_sec_context_lucid_v1() gss_accept_sec_context_lucid_v1() gss_supports_lucid() These are used to determine if the gssd can do the upcalls and uses them to avoid needing detailed Heimdal knowledge if they are supported. gss_init_sec_context_lucid_v1() and gss_accept_sec_context_lucid_v1() return the information needed to complete the RPCSEC_GSS context. They use gss_krb5_export_lucid_sec_context() to acquire the information from the libraries. (MIT Kerberos supports this and I believe newer versions of Heimdal does, as well). This avoids the need for detailed knowledge about MIT's internals and replaces the 2 or 4 (initiator or acceptor) upcalls with a single upcall to create the RPCSEC_GSS context. The old Heimdal (up to 1.5) support is left intact, but should be removed whenever Heimdal 1.5 is removed from /usr/src. It also modifies the Makefile so that the gssd is only built when MK_KERBEROS_SUPPORT != "no", since it is useless without Kerberos. Reviewed by: cy Differeential Revision: https://reviews.freebsd.org/D51731 Differeential Revision: https://reviews.freebsd.org/D51733
* Revert "kgssapi: Fix the kgssapi so that it can use MIT Kerberos"Rick Macklem2025-08-073-136/+42
| | | | | | This broke the build and will have to wait for cy@'s commit. This reverts commit 554651ebf1c1798fa8fb2560cab761ac3d219555.
* kgssapi: Fix the kgssapi so that it can use MIT KerberosRick Macklem2025-08-063-42/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without this patch, the kgssapi uses detailed knowledge of the internal context structure for Heimdal (up to vers 1.5). It also does four upcalls to the gssd daemon to establish a server side RPCSEC_GSS context. This patch adds support for three new upcalls: gss_init_sec_context_lucid_v1() gss_accept_sec_context_lucid_v1() gss_supports_lucid() These are used to determine if the gssd can do the upcalls and uses them to avoid needing detailed Heimdal knowledge if they are supported. gss_init_sec_context_lucid_v1() and gss_accept_sec_context_lucid_v1() return the information needed to complete the RPCSEC_GSS context. They use gss_krb5_export_lucid_sec_context() to acquire the information from the libraries. (MIT Kerberos supports this and I believe newer versions of Heimdal does, as well). This avoids the need for detailed knowledge about MIT's internals and replaces the 2 or 4 (initiator or acceptor) upcalls with a single upcall to create the RPCSEC_GSS context. The old Heimdal (up to 1.5) support is left intact, but should be removed whenever Heimdal 1.5 is removed from /usr/src. It also modifies the Makefile so that the gssd is only built when MK_KERBEROS_SUPPORT != "no", since it is useless without Kerberos. Reviewed by: cy Differential Revision: https://reviews.freebsd.org/D51731 Differential Revision: https://reviews.freebsd.org/D51733
* kern: rename crsetgroups_fallback, document it in ucred(9)Kyle Evans2025-08-011-1/+1
| | | | | | | | | | | | | | | | As of FreeBSD 15.0, crsetgroups() *only* sets supplementary groups, while crsetgroups_and_egid() will do both using an array of the same style that previous versions used for crsetgroups() -- i.e., the first element is the egid, and the remainder are supplementary groups. Unlike the previous iteration of crsetgroups(), crsetgroups_and_egid() is less prone to misuse as the caller must provide a default egid to use in case the array is empty. This is particularly useful for groups being set from data provided by userland. Reviewed by: olce Suggested by: olce Differential Revision: https://reviews.freebsd.org/D51647
* rpcsec_gss.c: Avoid panics in clnt_nl_call()Rick Macklem2025-07-191-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | When rpc_gss_init() calls gssd upcall functions like gssd_import_name(), clnt_nl_call() gets calls. clnt_nl_call() requires that the currect vnet be set up. The calling sequence looks something like: rpc_gss_init()->gssd_import_name()->gssd_import_name_1()-> clnt_call_private()->clnt_nl_call() (The call to rpc_gss_init() can happen from various places, such as nfs_getauth() and clnt_vc_call().) rpc_gss_init() does not know what socket is being used for NFS client->server RPCs and may be called from various places when any VOP_xxx()->RPC call is made. As such, the calling thread might be running within a jail. However, the gssd upcalls for the NFS client must always be done to the gssd running outside of any jails. This patch sets the CURVNET to vnet0 in rpc_gss_init() to fix the problem, since that is the vnet that always should be used. This must somehow be changed if NFS mounts in vnet jails is enabled. Reviewed by: glebius Differential Revision: https://reviews.freebsd.org/D51086
* machine/stdarg.h -> sys/stdarg.hBrooks Davis2025-06-111-1/+1
| | | | | | | | | | | | | Switch to using sys/stdarg.h for va_list type and va_* builtins. Make an attempt to insert the include in a sensible place. Where style(9) was followed this is easy, where it was ignored, aim for the first block of sys/*.h headers and don't get too fussy or try to fix other style bugs. Reviewed by: imp Exp-run by: antoine (PR 286274) Pull Request: https://github.com/freebsd/freebsd-src/pull/1595
* xdr: provide x_putmbuf method for kernel XDRGleb Smirnoff2025-02-011-6/+3
| | | | | | | | | Get it implemented for mbuf based XDR. Right now all existing consumers use only mbuf based XDR. However, future changes will require appending data stored in an mbuf to memory buffer based XDR. Reviewed by: rmacklem Differential Revision: https://reviews.freebsd.org/D48547
* nfs, rpc: Ensure kernel credentials have at least one groupOlivier Certner2024-11-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | This fixes several bugs where some 'struct ucred' in the kernel, constructed from user input (via nmount(2)) or obtained from other servers (e.g., gssd(8)), could have an unfilled 'cr_groups' field and whose 'cr_groups[0]' (or 'cr_gid', which is an alias) was later accessed, causing an uninitialized access giving random access rights. Use crsetgroups_fallback() to enforce a fallback group when possible. For NFS, the chosen fallback group is that of the NFS server in the current VNET (NFSD_VNET(nfsrv_defaultgid)). There does not seem to be any sensible fallback available in rpc code (sys/rpc/svc_auth.c, svc_getcred()) on AUTH_UNIX (TLS or not), so just fail credential retrieval there. Stock NSS sources, rpc.tlsservd(8) or rpc.tlsclntd(8) provide non-empty group lists, so will not be impacted. Discussed with: rmacklem (by mail) Approved by: markj (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D46918
* sys: Automated cleanup of cdefs and other formattingWarner Losh2023-11-275-5/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* krpc: Display stats of TLS usageRick Macklem2023-11-021-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds some sysctls: kern.rpc.unenc.tx_msgcnt kern.rpc.unenc.tx_msgbytes kern.rpc.unenc.rx_msgcnt kern.rpc.unenc.rx_msgbytes kern.rpc.tls.tx_msgcnt kern.rpc.tls.tx_msgbytes kern.rpc.tls.rx_msgcnt kern.rpc.tls.rx_msgbytes kern.rpc.tls.handshake_success kern.rpc.tls.handshake_failed kern.rpc.tls.alerts which allow a NFS server sysadmin to determine how much NFS-over-TLS is being used. A large number of failed handshakes might also indicate an NFS confirguration problem. This patch moves the definition of "kern.rpc" from the kgssapi module to the krpc module. As such, both modules need to be rebuilt from sources. Since __FreeBSD_version was bumped yesterday, I will not bump it again. Suggested by: gwollman Discussed on: freebsd-current MFC after: 1 month
* nfscl/kgssapi: Fix Kerberized NFS mounts to pNFS serversRick Macklem2023-10-231-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During recent testing related to the IETF NFSv4 Bakeathon, it was discovered that Kerberized NFSv4.1/4.2 mounts to pNFS servers (sec=krb5[ip],pnfs mount options) was broken. The FreeBSD client was using the "service principal" for the MDS to try and establish a rpcsec_gss credential for a DS, which is incorrect. (A "service principal" looks like "nfs@<fqdn-of-server>" and the <fqdn-of-server> for the DS is not the same as the MDS for most pNFS servers.) To fix this, the rpcsec_gss code needs to be able to do a reverse DNS lookup of the DS's IP address. A new kgssapi upcall to the gssd(8) daemon is added by this patch to do the reverse DNS along with a new rpcsec_gss function to generate the "service principal". A separate patch to the gssd(8) will be committed, so that this patch will fix the problem. Without the gssd(8) patch, the new upcall fails and current/incorrect behaviour remains. This bug only affects the rare case of a Kerberized (sec=krb5[ip],pnfs) mount using pNFS. This patch changes the internal KAPI between the kgssapi and nfscl modules, but since I did a version bump a few days ago, I will not do one this time. MFC after: 1 month
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-165-10/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* sys: Remove $FreeBSD$: one-line .c comment patternWarner Losh2023-08-161-1/+0
| | | | Remove /^/[*/]\s*\$FreeBSD\$.*\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-122-2/+2
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* svc_rpcsec_gss.c: Separate out the non-vnet initializationRick Macklem2023-03-011-11/+24
| | | | | | | | | | | | | | | Without this patch, a single initialization function was used to initialize both the vnet'd and non-vnet'd data. This patch separates out the non-vnet'd initializations into a separate function invoked by SYSINIT(). This avoids use of IS_DEFAULT_VNET() in the initialization functions and also configures the non-vnet'd initialization function to be called first, although ordering is not currently needed. Reviewed by: glebius MFC after: 3 months Differential Revision: https://reviews.freebsd.org/D38749
* nfsd: Add VNET_SYSUNINIT() macros for vnet cleanupRick Macklem2023-02-201-1/+14
| | | | | | | | | | | | | | | Commit ed03776ca7f4 enabled the vnet front end macros. As such, for kernels built with the VIMAGE option will malloc data and initialize locks on a per-vnet basis, typically via a VNET_SYSINIT(). This patch adds VNET_SYSUNINIT() macros to do the frees of the per-vnet malloc'd data and destroys of per-vnet locks. It also removes the mtx_lock/mtx_unlock calls from nfsrvd_cleancache(), since they are not needed. Discussed with: bz, jamie MFC after: 3 months
* nfsd: Enable the NFSD_VNET vnet front end macrosRick Macklem2023-02-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Several commits have added front end macros for the vnet macros to the NFS server, krpc and kgssapi. These macros are now null, but this patch changes them to front end the vnet macros. With this commit, many global variables in the code become vnet'd, so that nfsd(8), nfsuserd(8), rpc.tlsservd(8) and gssd(8) can run in a vnet prison, once enabled. To run the NFS server in a vnet prison still requires a couple of patches (in D37741 and D38371) that allow mountd(8) to export file systems from within a vnet prison. Once these are committed to main, a small patch to kern_jail.c allowing "allow.nfsd" without VNET_NFSD defined will allow the NFS server to run in a vnet prison. One area that still needs to be settled is cleanup when a prison is removed. Without this, everything should work except there will be a leak of malloc'd data and mutex locks when a vnet prison is removed. MFC after: 3 months
* kgssapi: Add macros so that gssd(8) can run in vnet prisonRick Macklem2023-02-151-40/+54
| | | | | | | | | | | | | Commit 7344856e3a6d added a lot of macros that will front end vnet macros so that nfsd(8) can run in vnet prison. This patch adds similar macros named KGSS_VNETxxx so that the gssd(8) daemon can run in a vnet prison, once the macros front end the vnet ones. For now, they are null macros. This is the last commit that adds macros. The next step is to change the macros to front end the vnet ones. MFC after: 3 months
* krpc: Allow mountd/nfsd to optionally run in a jailRick Macklem2022-12-181-1/+6
| | | | | | | | | | | | | | | | | | | | | | This patch modifies the kernel RPC so that it will allow mountd/nfsd to run inside of a vnet jail. Running mountd/nfsd inside a vnet jail will be enabled via a new kernel build option called VNET_NFSD, which will be implemented in future commits. Although I suspect cr_prison can be set from the credentials of the current thread unconditionally, I #ifdef'd the code VNET_NFSD and only did this for the jailed case mainly to document that it is only needed for use in a jail. The TLS support code has not yet been modified to work in a jail. That is planned as future development after the basic VNET_NFSD support is in the kernel. This patch should not result in any semantics change until VNET_NFSD is implemented and used in a kernel configuration. MFC after: 4 months
* sys/rpc: Use C99 fixed-width integer types.John Baldwin2021-12-281-1/+1
| | | | | | | No functional change. Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D33640
* rpc: Make function tables constMark Johnston2021-08-142-5/+5
| | | | | | | No functional change intended. MFC after: 1 week Sponsored by: The FreeBSD Foundation
* rpcsec_gss: Use a designated initializer for rpc_gss_opsMark Johnston2021-05-261-5/+5
| | | | | | | No functional change intended. MFC after: 1 week Sponsored by: The FreeBSD Foundation
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki2020-02-261-2/+4
| | | | | | | | | | | | | | | | | | | r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes. This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags. Mark all obvious cases as MPSAFE. All entries that haven't been marked as MPSAFE before are by default marked as NEEDGIANT Approved by: kib (mentor, blanket) Commented by: kib, gallatin, melifaro Differential Revision: https://reviews.freebsd.org/D23718 Notes: svn path=/head/; revision=358333
* Change r355157 to make svc_rpc_gss_lifetime_max a static.Rick Macklem2019-11-281-1/+1
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=355161
* Add a cap on credential lifetime for Kerberized NFS.Rick Macklem2019-11-281-1/+13
| | | | | | | | | | | | | | | | | | | | | The kernel RPCSEC_GSS code sets the credential (called a client) lifetime to the lifetime of the Kerberos ticket, which is typically several hours. As such, when a user's credentials change such as being added to a new group, it can take several hours for this change to be recognized by the NFS server. This patch adds a sysctl called kern.rpc.gss.lifetime_max which can be set by a sysadmin to put a cap on the time to expire for the credentials, so that a sysadmin can reduce the timeout. It also fixes a bug, where time_uptime is added twice when GSS_C_INDEFINITE is returned for a lifetime. This has no effect in practice, sine Kerberos never does this. Tested by: pen@lysator.liu.se PR: 242132 Submitted by: pen@lysator.liu.se MFC after: 2 weeks Notes: svn path=/head/; revision=355157
* Fix malloc stats for the RPCSEC_GSS server code when DEBUG is enabled.Rick Macklem2019-04-041-1/+1
| | | | | | | | | | | | | | | | The code enabled when "DEBUG" is defined uses mem_alloc(), which is a malloc(.., M_RPC, M_WAITOK | M_ZERO), but then calls gss_release_buffer() which does a free(.., M_GSSAPI) to free the memory. This patch fixes the problem by replacing mem_alloc() with a malloc(.., M_GSSAPI, M_WAITOK | M_ZERO). This bug affects almost no one, since the sources are not normally built with "DEBUG" defined. Submitted by: peter@ifm.liu.se MFC after: 2 weeks Notes: svn path=/head/; revision=345866
* Add a comment to the r345818 patch to explain why cl_refs is initialized to 2.Rick Macklem2019-04-031-0/+5
| | | | | | | | PR: 235582 MFC after: 2 weeks Notes: svn path=/head/; revision=345828
* Fix a race in the RPCSEC_GSS server code that caused crashes.Rick Macklem2019-04-021-8/+7
| | | | | | | | | | | | | | | | | | | | | | | When a new client structure was allocated, it was added to the list so that it was visible to other threads before the expiry time was initialized, with only a single reference count. The caller would increment the reference count, but it was possible for another thread to decrement the reference count to zero and free the structure before the caller incremented the reference count. This could occur because the expiry time was still set to zero when the new client structure was inserted in the list and the list was unlocked. This patch fixes the race by initializing the reference count to two and initializing all fields, including the expiry time, before inserting it in the list. Tested by: peter@ifm.liu.se PR: 235582 MFC after: 2 weeks Notes: svn path=/head/; revision=345818
* Bump the default kern.rpc.gss.client_max from 128 to 1024.Edward Tomasz Napierala2019-02-191-1/+1
| | | | | | | | | | | | | The old value resulted in bad performance, with high kernel and gssd(8) load, with more than ~64 clients; it also triggered crashes, which are to be fixed by a different patch. PR: 235582 Discussed with: rmacklem@ MFC after: 2 weeks Notes: svn path=/head/; revision=344276
* Add kern.rpc.gss.client_hash tunable, to make it possible to bumpEdward Tomasz Napierala2019-02-191-6/+12
| | | | | | | | | | | | it easily. This can lower the load on gssd(8) on large NFS servers. Submitted by: Per Andersson <pa at chalmers dot se> Reviewed by: rmacklem@ MFC after: 2 weeks Sponsored by: Chalmers University of Technology Notes: svn path=/head/; revision=344273
* Add kern.rpc.gss.client_max, to make it possible to bump it easily.Edward Tomasz Napierala2018-12-151-2/+15
| | | | | | | | | | | | | This can drastically lower the load on gssd(8) on large NFS servers. Submitted by: Per Andersson <pa at chalmers dot se> Reviewed by: rmacklem@ MFC after: 2 weeks Sponsored by: Chalmers University of Technology Differential Revision: https://reviews.freebsd.org/D18393 Notes: svn path=/head/; revision=342114
* sys: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-272-0/+4
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. No functional change intended. Notes: svn path=/head/; revision=326272
* sys: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-204-0/+9
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326023
* Hide the boottime and bootimebin globals, provide the getboottime(9)Konstantin Belousov2016-07-271-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | and getboottimebin(9) KPI. Change consumers of boottime to use the KPI. The variables were renamed to avoid shadowing issues with local variables of the same name. Issue is that boottime* should be adjusted from tc_windup(), which requires them to be members of the timehands structure. As a preparation, this commit only introduces the interface. Some uses of boottime were found doubtful, e.g. NLM uses boottime to identify the system boot instance. Arguably the identity should not change on the leap second adjustment, but the commit is about the timekeeping code and the consumers were kept bug-to-bug compatible. Tested by: pho (as part of the bigger patch) Reviewed by: jhb (same) Discussed with: bde Sponsored by: The FreeBSD Foundation MFC after: 1 month X-Differential revision: https://reviews.freebsd.org/D7302 Notes: svn path=/head/; revision=303382
* kgssapi(4): Fix string overrun in Kerberos principal constructionConrad Meyer2016-04-201-1/+1
| | | | | | | | | | | | 'buf.value' was previously treated as a nul-terminated string, but only allocated with strlen() space. Rectify this. Reported by: Coverity CID: 1007639 Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=298336
* Increase group limit for kerberized NFSv4Josh Paetzel2015-09-261-5/+2
| | | | | | | | | | | PR: 202659 Submitted by: matthew.l.dailey@dartmouth.edu Reviewed by: rmacklem dfr MFC after: 1 week Sponsored by: iXsystems Notes: svn path=/head/; revision=288272
* Add support for host-based (Kerberos 5 service principal) initiatorRick Macklem2013-07-091-10/+101
| | | | | | | | | | | credentials to the kernel rpc. Modify the NFSv4 client to add support for the gssname and allgssname mount options to use this capability. Requires the gssd daemon to be running with the "-h" option. Reviewed by: jhb Notes: svn path=/head/; revision=253049
* Improve error handling when unwrapping received data.George V. Neville-Neil2013-04-041-1/+16
| | | | | | | | Submitted by: Rick Macklem MFC after: 1 week Notes: svn path=/head/; revision=249096
* Mechanically substitute flags from historic mbuf allocator withGleb Smirnoff2012-12-051-2/+2
| | | | | | | | | | | | malloc(9) flags within sys. Exceptions: - sys/contrib not touched - sys/mbuf.h edited manually Notes: svn path=/head/; revision=243882
* Modify the comment to take out the names and URL.Rick Macklem2012-10-251-6/+3
| | | | | | | | Requested by: kib MFC after: 3 days Notes: svn path=/head/; revision=242090
* Add a comment describing why r241097 was done.Rick Macklem2012-10-151-0/+11
| | | | | | | | Suggested by: rwatson MFC after: 1 week Notes: svn path=/head/; revision=241582
* Attila Bogar and Herbert Poeckl both reported similar problemsRick Macklem2012-10-011-3/+4
| | | | | | | | | | | | | | | | | w.r.t. a Linux NFS client doing a krb5 NFS mount against the FreeBSD server. We determined this was a Linux bug: http://www.spinics.net/lists/linux-nfs/msg32466.html, however the mount failed to work, because the Destroy operation with a bogus encrypted checksum destroyed the authenticator handle. This patch changes the rpcsec_gss code so that it doesn't Destroy the authenticator handle for this case and, as such, the Linux mount will work. Tested by: Attila Bogar and Herbert Poeckl MFC after: 2 weeks Notes: svn path=/head/; revision=241097
* Remove an extraneous "already" from a comment introduced by r226081.Rick Macklem2011-10-071-1/+1
| | | | | | | | Submitted by: bf1783 at googlemail.com MFC after: 3 days Notes: svn path=/head/; revision=226104
* A crash reported on freebsd-fs@ on Sep. 23, 2011 under the subjectRick Macklem2011-10-071-10/+48
| | | | | | | | | | | | | | | | | | | | | | | | heading "kernel panics with RPCSEC_GSS" appears to be caused by a corrupted tailq list for the client structure. Looking at the code, calls to the function svc_rpc_gss_forget_client() were done in an SMP unsafe manner, with the svc_rpc_gss_lock only being acquired in the function and not before it. As such, when multiple threads called svc_rpc_gss_forget_client() concurrently, it could try and remove the same client structure from the tailq lists multiple times. The patch fixes this by moving the critical code into a separate function called svc_rpc_gss_forget_client_locked(), which must be called with the lock held. For the one case where the caller would have no interest in the lock, svc_rpc_gss_forget_client() was retained, but a loop was added to check that the client structure is still in the tailq lists before removing it, to make it safe for multiple concurrent calls. Tested by: clinton.adams at gmail.com (earlier version) Reviewed by: zkirsch MFC after: 3 days Notes: svn path=/head/; revision=226081
* Make options KGSSAPI build and add it to NOTES.Brooks Davis2010-01-082-8/+11
| | | | | | | | | | | rpcsec_gss_prot.c: Use kernel printf and headers. vc_rpcsec_gss.c: Use a local RPCAUTH_UNIXGIDS definition for 16 instead of using NGROUPS. Notes: svn path=/head/; revision=201853
* (S)LIST_HEAD_INITIALIZER takes a (S)LIST_HEAD as an argument.Antoine Brodin2009-12-281-2/+2
| | | | | | | | | | | | Fix some wrong usages. Note: this does not affect generated binaries as this argument is not used. PR: 137213 Submitted by: Eygene Ryabinkin (initial version) MFC after: 1 month Notes: svn path=/head/; revision=201145
* Set the prison in NFS anon and GSS SVC creds (as I indended to in r197581).Jamie Gritton2009-09-281-0/+2
| | | | | | | Reviewed by: marcel Notes: svn path=/head/; revision=197584
* Back out r197581, which replaced this file witk sys/kern/vfs_export.c.Jamie Gritton2009-09-281-369/+1363
| | | | | | | | | | | Who knew that "svn export" was an actual command, or that I would have vfs_export.c stuck in my mind deep enough to type "export" instead of "commit"? Pointy Hat to: jamie Notes: svn path=/head/; revision=197583
* Set the prison in NFS anon and GSS SVC creds.Jamie Gritton2009-09-281-1363/+369
| | | | | | | | Reviewed by: marcel MFC after: 3 days Notes: svn path=/head/; revision=197581