Re: [PATCH] fs/super: fix memory leak of s_fs_info on setup_bdev_super failure

kernel test robot
2025-11-26T14:01:56Z

Hello,

kernel test robot noticed "Oops:general_protection_fault,probably_for_non-canonical_address#:#[##]SMP_KASAN_PTI" on:

commit: 45f3d9974e382495db777e0290a32ba0cd6f454b ("[PATCH] fs/super: fix memory leak of s_fs_info on setup_bdev_super failure")
url: https://github.com/intel-lab-lkp/linux/commits/Mehdi-Ben-Hadj-Khelifa/fs-super-fix-memory-leak-of-s_fs_info-on-setup_bdev_super-failure/20251115-001149
base: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git 6da43bbeb6918164f7287269881a5f861ae09d7e
patch link: https://lore.kernel.org/all/20251114165255.101361-1-mehdi.benhadjkhelifa@gmail.com/
patch subject: [PATCH] fs/super: fix memory leak of s_fs_info on setup_bdev_super failure

in testcase: nvml
version: nvml-x86_64-4cbe1fd37-1_20251013
with following parameters:

test: non-pmem
group: util

config: x86_64-rhel-9.4-func
compiler: gcc-14
test machine: 8 threads 1 sockets Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz (Haswell) with 8G memory

(please refer to attached dmesg/kmsg for entire log/backtrace)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <oliver.sang@intel.com>
| Closes: https://lore.kernel.org/oe-lkp/202511262155.f86d1a5f-lkp@intel.com

[ 164.783048][T42994] EXT4-fs (loop0): VFS: Can't find ext4 filesystem
[ 164.792057][T42994] EXT4-fs (loop0): VFS: Can't find ext4 filesystem
[ 164.798663][T42994] Oops: general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] SMP KASAN PTI
[ 164.810433][T42994] KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
[ 164.818722][T42994] CPU: 3 UID: 0 PID: 42994 Comm: mount Tainted: G S 6.18.0-rc5-00215-g45f3d9974e38 #1 PREEMPT(voluntary)
[ 164.831362][T42994] Tainted: [S]=CPU_OUT_OF_SPEC
[ 164.835992][T42994] Hardware name: Dell Inc. OptiPlex 9020/0DNKMN, BIOS A05 12/05/2013
[ 164.843927][T42994] RIP: 0010:fuse_kill_sb_blk (kbuild/src/consumer/fs/fuse/inode.c:2126 kbuild/src/consumer/fs/fuse/inode.c:2153) fuse
[ 164.850056][T42994] Code: 00 00 00 00 00 fc ff df 48 c1 ea 03 80 3c 02 00 75 6a 48 8b 9b 90 03 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 da 48 c1 ea 03 <80> 3c 02 00 75 60 48 8b 3b e8 ec f8 ff ff 48 85 db 74 1a 48 83 c4
All code
========
0: 00 00 add %al,(%rax)
2: 00 00 add %al,(%rax)
4: 00 fc add %bh,%ah
6: ff lcall (bad)
7: df 48 c1 fisttps -0x3f(%rax)
a: ea (bad)
b: 03 80 3c 02 00 75 add 0x7500023c(%rax),%eax
11: 6a 48 push $0x48
13: 8b 9b 90 03 00 00 mov 0x390(%rbx),%ebx
19: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax
20: fc ff df
23: 48 89 da mov %rbx,%rdx
26: 48 c1 ea 03 shr $0x3,%rdx
2a:* 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1) <-- trapping instruction
2e: 75 60 jne 0x90
30: 48 8b 3b mov (%rbx),%rdi
33: e8 ec f8 ff ff call 0xfffffffffffff924
38: 48 85 db test %rbx,%rbx
3b: 74 1a je 0x57
3d: 48 rex.W
3e: 83 .byte 0x83
3f: c4 .byte 0xc4

Code starting with the faulting instruction
===========================================
0: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1)
4: 75 60 jne 0x66
6: 48 8b 3b mov (%rbx),%rdi
9: e8 ec f8 ff ff call 0xfffffffffffff8fa
e: 48 85 db test %rbx,%rbx
11: 74 1a je 0x2d
13: 48 rex.W
14: 83 .byte 0x83
15: c4 .byte 0xc4
[ 164.869568][T42994] RSP: 0018:ffffc900022dfbc8 EFLAGS: 00010246
[ 164.875504][T42994] RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffffff81580d23
[ 164.883352][T42994] RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff8882004c8014
[ 164.891213][T42994] RBP: ffffffffc020dba0 R08: 0000000000000001 R09: ffffed1040099000
[ 164.899068][T42994] R10: ffff8882004c8007 R11: ffffffff81e792d8 R12: 00000000ffffffea
[ 164.906921][T42994] R13: ffff88810dc18390 R14: ffffffffc0446ab0 R15: 00000000ffffffea
[ 164.914770][T42994] FS: 00007ff3e6309840(0000) GS:ffff88821483e000(0000) knlGS:0000000000000000
[ 164.923579][T42994] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 164.930038][T42994] CR2: 000055c480d92328 CR3: 00000001ec872005 CR4: 00000000001726f0
[ 164.937888][T42994] Call Trace:
[ 164.941038][T42994] <TASK>
[ 164.943841][T42994] ? __pfx_fuse_fill_super (kbuild/src/consumer/fs/fuse/inode.c:1939) fuse
[ 164.949619][T42994] deactivate_locked_super (kbuild/src/consumer/fs/super.c:434 kbuild/src/consumer/fs/super.c:475)
[ 164.954861][T42994] get_tree_bdev_flags (kbuild/src/consumer/fs/super.c:1699)
[ 164.959839][T42994] ? __pfx_get_tree_bdev_flags (kbuild/src/consumer/fs/super.c:1662)

The kernel config and materials to reproduce are available at:
https://download.01.org/0day-ci/archive/20251126/202511262155.f86d1a5f-lkp@intel.com

--
0-DAY CI Kernel Test Service