After upgrading my Ubuntu 22.04 installation to Ubuntu 24.04.1 (using do-release-upgrade) my NFS exports stopped working. Kernel 6.8.0-41 reported an OOPS as soon as the NFS share was accessed (using sec=krb5b on the NFS client):
[ 63.478030] general protection fault, probably for non-canonical address 0x8231a27a7b546ad9: 0000 [#1] PREEMPT SMP NOPTI
[ 63.478074] CPU: 3 PID: 14283 Comm: nfsd Tainted: P OE 6.8.0-41-generic #41-Ubuntu
[ 63.478098] Hardware name: ASUSTeK COMPUTER INC. MINIPC PN53/PN53, BIOS 21300 07/01/2024
[ 63.478119] RIP: 0010:gss_free_in_token_pages+0x31/0xe0 [auth_rpcgss]
[ 63.478156] Code: 89 e5 41 55 49 89 fd 41 54 53 48 8b 3f 48 8b 1f 48 85 db 74 47 45 31 e4 eb 10 49 8b 7d 00 49 63 c4 48 8b 1c c7 48 85 db 74 32 <48> 8b 43 08 41 83 c4 01 a8 01 0f 85 8a 00 00 00 66 90 66 90 f0 ff
[ 63.478189] RSP: 0018:ffffac85b19ebbd8 EFLAGS: 00010286
[ 63.478207] RAX: 0000000000000001 RBX: 8231a27a7b546ad1 RCX: 0000000000000000
[ 63.478226] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff9e3f50fed100
[ 63.478244] RBP: ffffac85b19ebbf0 R08: 0000000000000000 R09: 0000000000000000
[ 63.478263] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000001
[ 63.478282] R13: ffffac85b19ebc30 R14: ffff9e41315c3600 R15: ffff9e3f4838d000
[ 63.478301] FS: 0000000000000000(0000) GS:ffff9e4d61d80000(0000) knlGS:0000000000000000
[ 63.478322] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 63.478340] CR2: 000000c0002c4000 CR3: 00000004c519c000 CR4: 0000000000f50ef0
[ 63.478358] PKRU: 55555554
[ 63.478368] Call Trace:
[ 63.478380] <TASK>
[ 63.478392] ? show_regs+0x6d/0x80
[ 63.478409] ? die_addr+0x37/0xa0
[ 63.478423] ? exc_general_protection+0x1db/0x480
[ 63.478444] ? asm_exc_general_protection+0x27/0x30
[ 63.478467] ? gss_free_in_token_pages+0x31/0xe0 [auth_rpcgss]
[ 63.478497] ? gss_free_in_token_pages+0x53/0xe0 [auth_rpcgss]
[ 63.478525] svcauth_gss_proxy_init+0x113/0x270 [auth_rpcgss]
[ 63.478557] ? srso_alias_return_thunk+0x5/0xfbef5
[ 63.478573] svcauth_gss_proc_init+0xc3/0x150 [auth_rpcgss]
[ 63.478598] svcauth_gss_accept+0x3cc/0x710 [auth_rpcgss]
[ 63.478627] svc_authenticate+0xde/0x120 [sunrpc]
[ 63.478702] svc_process_common+0x23c/0x710 [sunrpc]
[ 63.478769] svc_process+0x132/0x1b0 [sunrpc]
[ 63.478833] svc_handle_xprt+0x4d3/0x5d0 [sunrpc]
[ 63.478902] svc_recv+0x18b/0x2e0 [sunrpc]
[ 63.478964] ? __pfx_nfsd+0x10/0x10 [nfsd]
[ 63.479027] nfsd+0x8b/0xe0 [nfsd]
[ 63.479077] kthread+0xf2/0x120
[ 63.479092] ? __pfx_kthread+0x10/0x10
[ 63.479106] ret_from_fork+0x47/0x70
[ 63.479120] ? __pfx_kthread+0x10/0x10
[ 63.479133] ret_from_fork_asm+0x1b/0x30
[ 63.479151] </TASK>
[ 63.479161] Modules linked in: rpcsec_gss_krb5 nfsd auth_rpcgss nfs_acl lockd grace sunrpc eq3_char_loop(OE) ip6table_filter ip6_tables iptable_filter pcspkr usbkbd sp5100_tco evbug xt_nat xt_tcpudp veth xt_conntrack nft_chain_nat xt_MASQUERADE nf_nat nf_conntrack_netlink nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 xfrm_user xfrm_algo xt_addrtype nft_compat nf_tables br_netfilter bridge stp llc overlay qrtr cmac algif_hash algif_skcipher af_alg bnep macvlan binfmt_misc snd_soc_acp6x_mach snd_soc_dmic snd_acp6x_pdm_dma snd_sof_amd_acp63 snd_sof_amd_vangogh snd_sof_amd_rembrandt snd_sof_amd_renoir snd_sof_amd_acp snd_hda_codec_realtek snd_sof_pci intel_rapl_msr snd_sof_xtensa_dsp snd_hda_codec_generic snd_hda_codec_hdmi intel_rapl_common snd_sof snd_hda_intel snd_sof_utils snd_intel_dspcfg mt7921e snd_intel_sdw_acpi amdgpu edac_mce_amd snd_hda_codec mt7921_common snd_soc_core mt792x_lib snd_hda_core mt76_connac_lib snd_compress kvm_amd snd_hwdep ac97_bus mt76 snd_pcm_dmaengine kvm snd_pci_ps snd_seq_midi
[ 63.479281] snd_rpl_pci_acp6x snd_seq_midi_event irqbypass amdxcp snd_acp_pci drm_exec snd_acp_legacy_common snd_rawmidi mac80211 gpu_sched snd_pci_acp6x btusb drm_buddy btrtl drm_suballoc_helper mfd_aaeon asus_nb_wmi btintel eeepc_wmi drm_ttm_helper snd_seq asus_wmi snd_pcm btbcm ttm ledtrig_audio cp210x btmtk sparse_keymap hb_rf_usb_2(OE) snd_seq_device nls_iso8859_1 snd_timer snd_pci_acp5x drm_display_helper usbserial generic_raw_uart(OE) rapl bluetooth wmi_bmof platform_profile i2c_piix4 cec cfg80211 snd snd_rn_pci_acp3x snd_acp_config ecdh_generic snd_soc_acpi rc_core soundcore snd_pci_acp3x zfs(PO) ecc i2c_algo_bit k10temp libarc4 ccp serial_multi_instantiate input_leds amd_pmc spl(O) acpi_tad mac_hid dm_multipath msr parport_pc ppdev lp parport nvme_fabrics efi_pstore nfnetlink dmi_sysfs ip_tables x_tables autofs4 btrfs blake2b_generic raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor raid6_pq libcrc32c raid1 raid0 hid_generic usbhid hid crct10dif_pclmul crc32_pclmul polyval_clmulni
[ 63.479556] polyval_generic ghash_clmulni_intel sha256_ssse3 nvme sha1_ssse3 ucsi_acpi thunderbolt r8169 video nvme_core ahci typec_ucsi xhci_pci xhci_pci_renesas libahci realtek nvme_auth typec wmi aesni_intel crypto_simd cryptd
[ 63.479795] ---[ end trace 0000000000000000 ]---
[ 65.418033] clocksource: Long readout interval, skipping watchdog check: cs_nsec: 2107923561 wd_nsec: 2107922654
[ 65.512800] RIP: 0010:gss_free_in_token_pages+0x31/0xe0 [auth_rpcgss]
[ 65.512845] Code: 89 e5 41 55 49 89 fd 41 54 53 48 8b 3f 48 8b 1f 48 85 db 74 47 45 31 e4 eb 10 49 8b 7d 00 49 63 c4 48 8b 1c c7 48 85 db 74 32 <48> 8b 43 08 41 83 c4 01 a8 01 0f 85 8a 00 00 00 66 90 66 90 f0 ff
[ 65.512874] RSP: 0018:ffffac85b19ebbd8 EFLAGS: 00010286
[ 65.512889] RAX: 0000000000000001 RBX: 8231a27a7b546ad1 RCX: 0000000000000000
[ 65.512907] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff9e3f50fed100
[ 65.512922] RBP: ffffac85b19ebbf0 R08: 0000000000000000 R09: 0000000000000000
[ 65.512937] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000001
[ 65.512953] R13: ffffac85b19ebc30 R14: ffff9e41315c3600 R15: ffff9e3f4838d000
[ 65.512970] FS: 0000000000000000(0000) GS:ffff9e4d61d80000(0000) knlGS:0000000000000000
[ 65.513024] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 65.513976] CR2: 000000c0002c4000 CR3: 00000004c519c000 CR4: 0000000000f50ef0
[ 65.514859] PKRU: 55555554
Looking for a similar bug I found one on the NFS kernel mailing list titled “[PATCH] SUNRPC: Fix loop termination condition in gss_free_in_token_pages()“.
In order to modify the ubuntu kernel source code I did this:
linux # apt install linux-source kernel-buildinfo-$(uname -r)
linux # mkdir /tmp/kernel
linux # cd /tmp/kernel
linux # tar xjf /usr/src/linux-source-6.8.0.tar.bz2
linux # cd linux-source-6.8.0
linux # ln -s /usr/lib/linux/$(uname -r)/ debian
linux # make oldconfig
linux # scripts/extract-vmlinux /boot/vmlinuz > vmlinux
linux # make -j8 modules
Update 2024.09.13: Just downloaded the newest linux-source package 6.8.0-44: The above patch is applied in this source tree, so hopefully the next kernel update will fix the above problem.
Update 2024.09.17: Just updated the kernel to version 6.8.0-45.45 and the problem is gone.