Bug 295714 - NFS server will hang if kgssapi.ko is loaded and the gssd daemon is not running
Summary: NFS server will hang if kgssapi.ko is loaded and the gssd daemon is not running
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 15.1-RELEASE
Hardware: Any Any
: --- Affects Some People
Assignee: Rick Macklem
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-05-30 02:59 UTC by Rick Macklem
Modified: 2026-07-05 23:06 UTC (History)
2 users (show)

See Also:
rmacklem: mfc-stable15+
rmacklem: mfc-stable14-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rick Macklem freebsd_committer freebsd_triage 2026-05-30 02:59:08 UTC
If the kgssapi.ko is loaded in the system
and the gssd daemon is not running, the NFS
server will hang during startup trying to
do an upcall to the gssd.

The workaround is either "don't load the
kgssapi.ko" or run the gssd. (The rest of
Kerberos doesn't need to be working, but
the gssd daemon does need to be running.)

I am working on a patch.
Comment 1 commit-hook freebsd_committer freebsd_triage 2026-06-21 23:17:39 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=455c354dd4dbba9b9ec9c68e335ab3aa46dca438

commit 455c354dd4dbba9b9ec9c68e335ab3aa46dca438
Author:     Rick Macklem <rmacklem@FreeBSD.org>
AuthorDate: 2026-06-21 23:15:23 +0000
Commit:     Rick Macklem <rmacklem@FreeBSD.org>
CommitDate: 2026-06-21 23:15:23 +0000

    gss_impl.c: Fix a nfsd hang when the kgssapi.ko is loaded, but no gssd

    After the conversion to using netlink, the kgssapi had
    no way of knowing if the gssd daemon was running.
    As such, a boot where the kgssapi is loaded, but the
    gssd is not enabled would hang the nfsd for a very
    long time. (Many timeouts at 300sec each.)

    This patch adds a Null RPC upcall with a 200msec
    timeout to check to see if the gssd is running.
    If the gssd is not running, the nfsd starts up
    (without Kerberos support) with only a 200msec
    delay.)

    Also, move the svc_svc_nl_create() and svc_reg() calls in gssd.c
    to before the daemon() call, so they are guaranteed to have
    been done before the nfsd(8) daemon is started by
    the rc scripts.

    PR:     295714
    Reviewed by:    glebius
    MFC after:      2 weeks
    Differential Revision:  https://reviews.freebsd.org/D57455

 sys/kgssapi/gss_impl.c | 42 ++++++++++++++++++++++++++++++++++++++++--
 usr.sbin/gssd/gssd.c   | 22 +++++-----------------
 2 files changed, 45 insertions(+), 19 deletions(-)
Comment 2 Rick Macklem freebsd_committer freebsd_triage 2026-06-21 23:20:08 UTC
Patches have been committed and will be MFC'd.
Comment 3 commit-hook freebsd_committer freebsd_triage 2026-07-05 23:04:58 UTC
A commit in branch stable/15 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=0c48190463a5c895270be09c45b1471633ddd602

commit 0c48190463a5c895270be09c45b1471633ddd602
Author:     Rick Macklem <rmacklem@FreeBSD.org>
AuthorDate: 2026-06-21 23:15:23 +0000
Commit:     Rick Macklem <rmacklem@FreeBSD.org>
CommitDate: 2026-07-05 23:02:37 +0000

    gss_impl.c: Fix a nfsd hang when the kgssapi.ko is loaded, but no gssd

    After the conversion to using netlink, the kgssapi had
    no way of knowing if the gssd daemon was running.
    As such, a boot where the kgssapi is loaded, but the
    gssd is not enabled would hang the nfsd for a very
    long time. (Many timeouts at 300sec each.)

    This patch adds a Null RPC upcall with a 200msec
    timeout to check to see if the gssd is running.
    If the gssd is not running, the nfsd starts up
    (without Kerberos support) with only a 200msec
    delay.)

    Also, move the svc_svc_nl_create() and svc_reg() calls in gssd.c
    to before the daemon() call, so they are guaranteed to have
    been done before the nfsd(8) daemon is started by
    the rc scripts.

    PR:     295714

    (cherry picked from commit 455c354dd4dbba9b9ec9c68e335ab3aa46dca438)

 sys/kgssapi/gss_impl.c | 42 ++++++++++++++++++++++++++++++++++++++++--
 usr.sbin/gssd/gssd.c   | 22 +++++-----------------
 2 files changed, 45 insertions(+), 19 deletions(-)
Comment 4 Rick Macklem freebsd_committer freebsd_triage 2026-07-05 23:06:30 UTC
Patch has been MFC'd.