When I tried to mount a nfsv4, I got a kernel BUG as below, and the nfs isn't mounted: # cat /etc/exports /mnt/nfscratch *(rw,insecure,no_root_squash) # service nfs-server restart # mount -t nfs $mylocalhost:/mnt/nfscratch /mnt/scratch # mount|grep scratch (empty) # uname -r 5.0.0-rc1-mainline+ # dmesg [ 9844.608193] Installing knfsd (copyright (C) 1996 okir@monad.swb.de). [ 9844.881979] NFSD: starting 45-second grace period (net f00000a8) [ 9862.896022] FS-Cache: Loaded [ 9863.163074] FS-Cache: Netfs 'nfs' registered for caching [ 9863.197862] Key type dns_resolver registered [ 9863.700766] NFS: Registering the id_resolver key type [ 9863.706503] Key type id_resolver registered [ 9863.711222] Key type id_legacy registered [ 9863.783495] CRED: Invalid credentials [ 9863.787920] CRED: At include/linux/cred.h:253 [ 9863.792820] CRED: Specified credentials: 000000001efc42de [ 9863.798976] CRED: ->magic=0, put_addr= (null) [ 9863.804736] CRED: ->usage=1, subscr=0 [ 9863.808846] CRED: ->*uid = { 0,0,0,0 } [ 9863.813053] CRED: ->*gid = { 0,0,0,0 } [ 9863.817261] CRED: ->security is (null) [ 9863.822456] ------------[ cut here ]------------ [ 9863.827612] kernel BUG at kernel/cred.c:825! [ 9863.832409] invalid opcode: 0000 [#1] SMP KASAN PTI [ 9863.837854] CPU: 2 PID: 3097 Comm: mount.nfs Not tainted 5.0.0-rc1-mainline+ #2 [ 9863.846012] Hardware name: IBM System x3650 M4 -[7915ON3]-/00J6520, BIOS -[VVE124AUS-1.30]- 11/21/2012 [ 9863.856407] RIP: 0010:__invalid_creds+0x48/0x4a [ 9863.861463] Code: 44 89 e2 48 89 ee 48 c7 c7 00 71 e8 b4 e8 c5 b3 0e 00 48 c7 c6 40 71 e8 b4 48 89 df 65 48 8b 14 25 80 e1 01 00 e8 3a fb ff ff <0f> 0b 48 c7 c7 80 71 e8 b4 e8 9f b3 0e 00 48 8b 34 24 44 89 fa 48 [ 9863.882419] RSP: 0018:ffff8881d9b075b8 EFLAGS: 00010293 [ 9863.888250] RAX: dffffc0000000000 RBX: ffffffffc12d2380 RCX: ffffffffb3ad6af2 [ 9863.896213] RDX: 1ffffffff825a481 RSI: 0000000000000008 RDI: ffff8881e59e602c [ 9863.904175] RBP: ffffffffc1bdac60 R08: ffffed103cb3cf81 R09: ffffed103cb3cf80 [ 9863.912137] R10: ffffed103cb3cf80 R11: ffff8881e59e7c07 R12: 00000000000000fd [ 9863.920101] R13: ffffffffc1bd4b40 R14: ffffffffc12d2380 R15: ffff8881d9b07908 [ 9863.928065] FS: 00007f1bdbb21880(0000) GS:ffff8881e5800000(0000) knlGS:0000000000000000 [ 9863.937097] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 9863.943508] CR2: 00007f411e24c000 CR3: 00000001e2f18005 CR4: 00000000000606e0 [ 9863.951472] Call Trace: [ 9863.954237] nfs4_discover_server_trunking+0x4e5/0x5d0 [nfsv4] [ 9863.960773] nfs4_init_client+0x35e/0x570 [nfsv4] [ 9863.966044] ? nfs41_init_client+0x70/0x70 [nfsv4] [ 9863.971392] ? lock_downgrade+0x5d0/0x5d0 [ 9863.975870] ? do_raw_spin_unlock+0x54/0x220 [ 9863.980639] ? _raw_spin_unlock+0x24/0x30 [ 9863.985132] ? nfs_get_client+0x745/0x10d0 [nfs] [ 9863.990284] ? lockdep_hardirqs_on+0x37c/0x560 [ 9863.995271] nfs4_set_client+0x205/0x380 [nfsv4] [ 9864.000447] ? nfs4_set_ds_client+0x2c0/0x2c0 [nfsv4] [ 9864.006112] ? __rpc_init_priority_wait_queue+0x258/0x390 [sunrpc] [ 9864.013033] nfs4_create_server+0x4b3/0xbc0 [nfsv4] [ 9864.018480] ? rcu_read_lock_sched_held+0x114/0x130 [ 9864.023942] ? nfs4_find_client_sessionid+0x860/0x860 [nfsv4] [ 9864.030373] nfs4_remote_mount+0x43/0x80 [nfsv4] [ 9864.035528] mount_fs+0xce/0x30a [ 9864.039131] ? lockdep_init_map+0x12f/0x4f0 [ 9864.043798] ? emergency_thaw_all+0x170/0x170 [ 9864.048658] ? lockdep_init_map+0x12f/0x4f0 [ 9864.053330] ? __init_waitqueue_head+0x3a/0x90 [ 9864.058293] vfs_kern_mount.part.34+0x58/0x3b0 [ 9864.063273] nfs_do_root_mount+0x7f/0xc0 [nfsv4] [ 9864.068427] ? do_raw_spin_unlock+0x54/0x220 [ 9864.073213] nfs4_try_mount+0xdb/0x1e0 [nfsv4] [ 9864.078186] nfs_fs_mount+0x1358/0x2900 [nfs] [ 9864.083063] ? nfs_remount+0x1c20/0x1c20 [nfs] [ 9864.088023] ? rcu_read_lock_sched_held+0x114/0x130 [ 9864.093470] ? pcpu_alloc+0xa88/0xc40 [ 9864.097569] ? nfs_clone_super+0x400/0x400 [nfs] [ 9864.102733] ? nfs_parse_mount_options+0x1c20/0x1c20 [nfs] [ 9864.108857] ? pcpu_create_chunk+0x730/0x730 [ 9864.113615] mount_fs+0xce/0x30a [ 9864.117208] ? lockdep_init_map+0x12f/0x4f0 [ 9864.121877] ? emergency_thaw_all+0x170/0x170 [ 9864.126738] ? lockdep_init_map+0x12f/0x4f0 [ 9864.131407] ? __init_waitqueue_head+0x3a/0x90 [ 9864.136375] vfs_kern_mount.part.34+0x58/0x3b0 [ 9864.141335] do_mount+0x392/0x25b0 [ 9864.145133] ? copy_mount_string+0x20/0x20 [ 9864.149709] ? kasan_kmalloc+0xc6/0xd0 [ 9864.153894] ? copy_mount_options+0x57/0x320 [ 9864.158651] ? kmem_cache_alloc_trace+0x14f/0x340 [ 9864.163900] ? copy_mount_options+0x57/0x320 [ 9864.168667] ? copy_mount_options+0x57/0x320 [ 9864.173433] ksys_mount+0xba/0xd0 [ 9864.177125] __x64_sys_mount+0xba/0x150 [ 9864.181398] do_syscall_64+0x9f/0x480 [ 9864.185477] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 9864.191115] RIP: 0033:0x7f1bdafa556e [ 9864.195104] Code: 48 8b 0d 1d 09 2c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d ea 08 2c 00 f7 d8 64 89 01 48 [ 9864.216060] RSP: 002b:00007fff9134a568 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 [ 9864.224511] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f1bdafa556e [ 9864.232473] RDX: 000055dbfb6ef460 RSI: 000055dbfb6ef480 RDI: 000055dbfb6f11d0 [ 9864.240436] RBP: 00007fff9134a6f0 R08: 000055dbfb6f2f30 R09: 00007fff913498c0 [ 9864.248399] R10: 0000000000000000 R11: 0000000000000246 R12: 00007fff9134a6f0 [ 9864.256369] R13: 000055dbfb6f24f0 R14: 0000000000000010 R15: 000055dbfae5fb19 [ 9864.264339] Modules linked in: rpcsec_gss_krb5 nfsv4 dns_resolver nfs fscache nfsd auth_rpcgss nfs_acl lockd grace sunrpc intel_rapl sb_edac x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm irqbypass ipmi_ssif crct10dif_pclmul crc32_pclmul ghash_clmulni_intel intel_cstate iTCO_wdt iTCO_vendor_support intel_uncore ipmi_si intel_rapl_perf ipmi_devintf sg pcspkr i2c_i801 lpc_ich ipmi_msghandler ioatdma xfs libcrc32c sd_mod mgag200 drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops ttm wmi drm igb crc32c_intel dca megaraid_sas i2c_algo_bit rndis_host cdc_ether usbnet mii dm_mirror dm_region_hash dm_log dm_mod [ 9864.326405] ---[ end trace 49c04d8b7024ed44 ]--- [ 9864.331574] RIP: 0010:__invalid_creds+0x48/0x4a [ 9864.336639] Code: 44 89 e2 48 89 ee 48 c7 c7 00 71 e8 b4 e8 c5 b3 0e 00 48 c7 c6 40 71 e8 b4 48 89 df 65 48 8b 14 25 80 e1 01 00 e8 3a fb ff ff <0f> 0b 48 c7 c7 80 71 e8 b4 e8 9f b3 0e 00 48 8b 34 24 44 89 fa 48 [ 9864.357610] RSP: 0018:ffff8881d9b075b8 EFLAGS: 00010293 [ 9864.363457] RAX: dffffc0000000000 RBX: ffffffffc12d2380 RCX: ffffffffb3ad6af2 [ 9864.371435] RDX: 1ffffffff825a481 RSI: 0000000000000008 RDI: ffff8881e59e602c [ 9864.379411] RBP: ffffffffc1bdac60 R08: ffffed103cb3cf81 R09: ffffed103cb3cf80 [ 9864.387388] R10: ffffed103cb3cf80 R11: ffff8881e59e7c07 R12: 00000000000000fd [ 9864.395365] R13: ffffffffc1bd4b40 R14: ffffffffc12d2380 R15: ffff8881d9b07908 [ 9864.403343] FS: 00007f1bdbb21880(0000) GS:ffff8881e5800000(0000) knlGS:0000000000000000 [ 9864.412386] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 9864.418813] CR2: 00007f411e24c000 CR3: 00000001e2f18005 CR4: 00000000000606e0
OK, I can't reproduce this bug on linux-5.0.0-rc3+, so I think this issue has been fixed.
commit e7f45099442a380f8e087b6a8aadc36e887df1cc Author: Santosh kumar pradhan <santoshkumar.pradhan@wdc.com> Date: Wed Jan 9 22:08:26 2019 +0530 sunrpc: kernel BUG at kernel/cred.c:825! Init missing debug member magic with CRED_MAGIC. Signed-off-by: Santosh kumar pradhan <santoshkumar.pradhan@wdc.com> Reported-by: Dave Jones <davej@codemonkey.org.uk> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com> Which is made into 5.0-rc3.