<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/kgssapi, branch stable/14</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>kgssapi: Remove broken MOD_UNLOAD code</title>
<updated>2025-12-09T16:40:33+00:00</updated>
<author>
<name>Ed Maste</name>
<email>emaste@FreeBSD.org</email>
</author>
<published>2025-11-27T16:44:08+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=63b77ab1554eb642ad28c35339f08ccfeaab13e5'/>
<id>63b77ab1554eb642ad28c35339f08ccfeaab13e5</id>
<content type='text'>
The module panicked at unload with "recursing but non-recursive rw".
There is a comment that "Unloading of the kgssapi module is not
currently supported" and the MOD_UNLOAD case falls through to returning
EOPNOTSUPP anyway.  Just #if 0 the code in the unload path, leaving it
as a hint in case someone implements unload support later on.

PR:		291249
Reviewed by:	rmacklem
Fixes: ad704a34bc2c ("Use syscall_helper_register(9) rather than syscall_register().")
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53949

(cherry picked from commit 6901376f59b870ddbb0d922e3455a388333cd460)
(cherry picked from commit ab4f4f4efaac85bbf235e60f2ced4876a9e916f2)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The module panicked at unload with "recursing but non-recursive rw".
There is a comment that "Unloading of the kgssapi module is not
currently supported" and the MOD_UNLOAD case falls through to returning
EOPNOTSUPP anyway.  Just #if 0 the code in the unload path, leaving it
as a hint in case someone implements unload support later on.

PR:		291249
Reviewed by:	rmacklem
Fixes: ad704a34bc2c ("Use syscall_helper_register(9) rather than syscall_register().")
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53949

(cherry picked from commit 6901376f59b870ddbb0d922e3455a388333cd460)
(cherry picked from commit ab4f4f4efaac85bbf235e60f2ced4876a9e916f2)
</pre>
</div>
</content>
</entry>
<entry>
<title>krb5: Fix handling of transient crypto request failures</title>
<updated>2025-06-01T19:53:29+00:00</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2025-05-09T00:16:53+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=cdf6e2d9feec03b0995c54be46d70471c3d69e5f'/>
<id>cdf6e2d9feec03b0995c54be46d70471c3d69e5f</id>
<content type='text'>
- Instead of using CRYPTO_F_DONE to decide whether a request has
  completed, use a custom protocol of setting crp_opaque = NULL in the
  callback and checking that instead.  CRYPTO_F_DONE is set independent
  of whether an error occurred, but for transient errors signaled by
  EAGAIN, we want to simply retry the request.
- Clear CRYPTO_F_DONE before retrying the request.
- Panic if the request truly failed, as we currently have no way to
  pass hard errors back up.

Reviewed by:	jhb
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D50238

(cherry picked from commit 04421fda140b92eb0d22bc4c0f81b6de05f21225)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Instead of using CRYPTO_F_DONE to decide whether a request has
  completed, use a custom protocol of setting crp_opaque = NULL in the
  callback and checking that instead.  CRYPTO_F_DONE is set independent
  of whether an error occurred, but for transient errors signaled by
  EAGAIN, we want to simply retry the request.
- Clear CRYPTO_F_DONE before retrying the request.
- Panic if the request truly failed, as we currently have no way to
  pass hard errors back up.

Reviewed by:	jhb
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D50238

(cherry picked from commit 04421fda140b92eb0d22bc4c0f81b6de05f21225)
</pre>
</div>
</content>
</entry>
<entry>
<title>nfscl/kgssapi: Fix Kerberized NFS mounts to pNFS servers</title>
<updated>2023-12-24T01:03:58+00:00</updated>
<author>
<name>Rick Macklem</name>
<email>rmacklem@FreeBSD.org</email>
</author>
<published>2023-10-23T20:21:14+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=b9410313c66d8a23e51a5d2c9730cee7e1586317'/>
<id>b9410313c66d8a23e51a5d2c9730cee7e1586317</id>
<content type='text'>
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@&lt;fqdn-of-server&gt;" and the &lt;fqdn-of-server&gt; 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.

(cherry picked from commit dd7d42a1fae5a4879b62689a165238082421f343)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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@&lt;fqdn-of-server&gt;" and the &lt;fqdn-of-server&gt; 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.

(cherry picked from commit dd7d42a1fae5a4879b62689a165238082421f343)
</pre>
</div>
</content>
</entry>
<entry>
<title>kgssapi: Add a new file with a function for a future commit</title>
<updated>2023-12-24T01:01:11+00:00</updated>
<author>
<name>Rick Macklem</name>
<email>rmacklem@FreeBSD.org</email>
</author>
<published>2023-10-23T20:17:16+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=1ae724792ced8ea56ecc6a9c19b67741be9859cc'/>
<id>1ae724792ced8ea56ecc6a9c19b67741be9859cc</id>
<content type='text'>
A future commit needs a new upcall function that can do reverse
DNS in order to generate a "service principal".
This patch adds the file.

(cherry picked from commit 428879dc9110240ad0940c7ac8cd69bcaf6e686e)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A future commit needs a new upcall function that can do reverse
DNS in order to generate a "service principal".
This patch adds the file.

(cherry picked from commit 428879dc9110240ad0940c7ac8cd69bcaf6e686e)
</pre>
</div>
</content>
</entry>
<entry>
<title>sys: Remove $FreeBSD$: one-line sh pattern</title>
<updated>2023-08-16T17:54:58+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:54:58+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=031beb4e239bfce798af17f5fe8dba8bcaf13d99'/>
<id>031beb4e239bfce798af17f5fe8dba8bcaf13d99</id>
<content type='text'>
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
</pre>
</div>
</content>
</entry>
<entry>
<title>sys: Remove $FreeBSD$: one-line .c pattern</title>
<updated>2023-08-16T17:54:36+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:54:36+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=685dc743dc3b5645e34836464128e1c0558b404b'/>
<id>685dc743dc3b5645e34836464128e1c0558b404b</id>
<content type='text'>
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
</pre>
</div>
</content>
</entry>
<entry>
<title>sys: Remove $FreeBSD$: one-line .c comment pattern</title>
<updated>2023-08-16T17:54:24+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:54:24+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=71625ec9ad2a9bc8c09784fbd23b759830e0ee5f'/>
<id>71625ec9ad2a9bc8c09784fbd23b759830e0ee5f</id>
<content type='text'>
Remove /^/[*/]\s*\$FreeBSD\$.*\n/
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove /^/[*/]\s*\$FreeBSD\$.*\n/
</pre>
</div>
</content>
</entry>
<entry>
<title>sys: Remove $FreeBSD$: two-line .h pattern</title>
<updated>2023-08-16T17:54:11+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:54:11+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=95ee2897e98f5d444f26ed2334cc7c439f9c16c6'/>
<id>95ee2897e98f5d444f26ed2334cc7c439f9c16c6</id>
<content type='text'>
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
</pre>
</div>
</content>
</entry>
<entry>
<title>spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD</title>
<updated>2023-05-12T16:44:03+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-05-10T15:40:58+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=4d846d260e2b9a3d4d0a701462568268cbfe7a5b'/>
<id>4d846d260e2b9a3d4d0a701462568268cbfe7a5b</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>nfsd: Enable the NFSD_VNET vnet front end macros</title>
<updated>2023-02-18T22:59:36+00:00</updated>
<author>
<name>Rick Macklem</name>
<email>rmacklem@FreeBSD.org</email>
</author>
<published>2023-02-18T22:59:36+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=ed03776ca7f43de8275da80cfa89a9ecc4732f82'/>
<id>ed03776ca7f43de8275da80cfa89a9ecc4732f82</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
</feed>
