* [syzbot] [cifs?] memory leak in smb3_fs_context_fullpath
@ 2025-11-13 4:26 syzbot
2025-11-18 8:58 ` shaurya
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: syzbot @ 2025-11-13 4:26 UTC (permalink / raw)
To: bharathsm, linux-cifs, linux-kernel, pc, ronniesahlberg,
samba-technical, sfrench, sprasad, syzkaller-bugs, tom
Hello,
syzbot found the following issue on:
HEAD commit: 4ea7c1717f3f Merge tag 'for-linus' of git://git.kernel.org..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=11b75c12580000
kernel config: https://syzkaller.appspot.com/x/.config?x=cb128cd5cb439809
dashboard link: https://syzkaller.appspot.com/bug?extid=87be6809ed9bf6d718e3
compiler: gcc (Debian 12.2.0-14+deb12u1) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=15350658580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=160d960a580000
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/1f8cf51c9042/disk-4ea7c171.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/6f227246b5b7/vmlinux-4ea7c171.xz
kernel image: https://storage.googleapis.com/syzbot-assets/f935766a00b3/bzImage-4ea7c171.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+87be6809ed9bf6d718e3@syzkaller.appspotmail.com
2025/11/11 03:33:01 executed programs: 5
BUG: memory leak
unreferenced object 0xffff888110616300 (size 192):
comm "syz.0.17", pid 6091, jiffies 4294942682
hex dump (first 32 bytes):
2f 2f f2 2f 06 08 2f df 2f 6f dc ea 95 9a 82 10 //./.././o......
97 57 8f 37 98 9b 2f f9 0d 6d 44 94 29 55 db 15 .W.7../..mD.)U..
backtrace (crc 93bb458c):
kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
slab_post_alloc_hook mm/slub.c:4979 [inline]
slab_alloc_node mm/slub.c:5284 [inline]
__do_kmalloc_node mm/slub.c:5645 [inline]
__kmalloc_noprof+0x3e3/0x6b0 mm/slub.c:5658
kmalloc_noprof include/linux/slab.h:961 [inline]
smb3_fs_context_fullpath+0x70/0x1b0 fs/smb/client/fs_context.c:629
smb3_fs_context_parse_param+0x2266/0x36c0 fs/smb/client/fs_context.c:1438
vfs_parse_fs_param+0xf4/0x190 fs/fs_context.c:146
vfs_fsconfig_locked fs/fsopen.c:303 [inline]
__do_sys_fsconfig+0x7d3/0x900 fs/fsopen.c:473
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xa4/0xfa0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
BUG: memory leak
unreferenced object 0xffff888110616180 (size 192):
comm "syz.0.17", pid 6091, jiffies 4294942682
hex dump (first 32 bytes):
2f 2f f2 2f 06 08 2f df 2f 6f dc ea 95 9a 82 10 //./.././o......
97 57 8f 37 98 9b 2f f9 0d 6d 44 94 29 55 db 15 .W.7../..mD.)U..
backtrace (crc 93bb458c):
kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
slab_post_alloc_hook mm/slub.c:4979 [inline]
slab_alloc_node mm/slub.c:5284 [inline]
__do_kmalloc_node mm/slub.c:5645 [inline]
__kmalloc_node_track_caller_noprof+0x3aa/0x6b0 mm/slub.c:5755
__kmemdup_nul mm/util.c:64 [inline]
kstrdup+0x3c/0x80 mm/util.c:84
smb3_fs_context_parse_param+0x229b/0x36c0 fs/smb/client/fs_context.c:1444
vfs_parse_fs_param+0xf4/0x190 fs/fs_context.c:146
vfs_fsconfig_locked fs/fsopen.c:303 [inline]
__do_sys_fsconfig+0x7d3/0x900 fs/fsopen.c:473
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xa4/0xfa0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
BUG: memory leak
unreferenced object 0xffff888128172cc0 (size 192):
comm "syz.0.18", pid 6093, jiffies 4294942683
hex dump (first 32 bytes):
2f 2f f2 2f 06 08 2f df 2f 6f dc ea 95 9a 82 10 //./.././o......
97 57 8f 37 98 9b 2f f9 0d 6d 44 94 29 55 db 15 .W.7../..mD.)U..
backtrace (crc 93bb458c):
kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
slab_post_alloc_hook mm/slub.c:4979 [inline]
slab_alloc_node mm/slub.c:5284 [inline]
__do_kmalloc_node mm/slub.c:5645 [inline]
__kmalloc_noprof+0x3e3/0x6b0 mm/slub.c:5658
kmalloc_noprof include/linux/slab.h:961 [inline]
smb3_fs_context_fullpath+0x70/0x1b0 fs/smb/client/fs_context.c:629
smb3_fs_context_parse_param+0x2266/0x36c0 fs/smb/client/fs_context.c:1438
vfs_parse_fs_param+0xf4/0x190 fs/fs_context.c:146
vfs_fsconfig_locked fs/fsopen.c:303 [inline]
__do_sys_fsconfig+0x7d3/0x900 fs/fsopen.c:473
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xa4/0xfa0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
BUG: memory leak
unreferenced object 0xffff888128172180 (size 192):
comm "syz.0.18", pid 6093, jiffies 4294942683
hex dump (first 32 bytes):
2f 2f f2 2f 06 08 2f df 2f 6f dc ea 95 9a 82 10 //./.././o......
97 57 8f 37 98 9b 2f f9 0d 6d 44 94 29 55 db 15 .W.7../..mD.)U..
backtrace (crc 93bb458c):
kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
slab_post_alloc_hook mm/slub.c:4979 [inline]
slab_alloc_node mm/slub.c:5284 [inline]
__do_kmalloc_node mm/slub.c:5645 [inline]
__kmalloc_node_track_caller_noprof+0x3aa/0x6b0 mm/slub.c:5755
__kmemdup_nul mm/util.c:64 [inline]
kstrdup+0x3c/0x80 mm/util.c:84
smb3_fs_context_parse_param+0x229b/0x36c0 fs/smb/client/fs_context.c:1444
vfs_parse_fs_param+0xf4/0x190 fs/fs_context.c:146
vfs_fsconfig_locked fs/fsopen.c:303 [inline]
__do_sys_fsconfig+0x7d3/0x900 fs/fsopen.c:473
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xa4/0xfa0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
BUG: memory leak
unreferenced object 0xffff888128172000 (size 192):
comm "syz.0.19", pid 6098, jiffies 4294942685
hex dump (first 32 bytes):
2f 2f f2 2f 06 08 2f df 2f 6f dc ea 95 9a 82 10 //./.././o......
97 57 8f 37 98 9b 2f f9 0d 6d 44 94 29 55 db 15 .W.7../..mD.)U..
backtrace (crc 93bb458c):
kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
slab_post_alloc_hook mm/slub.c:4979 [inline]
slab_alloc_node mm/slub.c:5284 [inline]
__do_kmalloc_node mm/slub.c:5645 [inline]
__kmalloc_noprof+0x3e3/0x6b0 mm/slub.c:5658
kmalloc_noprof include/linux/slab.h:961 [inline]
smb3_fs_context_fullpath+0x70/0x1b0 fs/smb/client/fs_context.c:629
smb3_fs_context_parse_param+0x2266/0x36c0 fs/smb/client/fs_context.c:1438
vfs_parse_fs_param+0xf4/0x190 fs/fs_context.c:146
vfs_fsconfig_locked fs/fsopen.c:303 [inline]
__do_sys_fsconfig+0x7d3/0x900 fs/fsopen.c:473
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xa4/0xfa0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
BUG: memory leak
unreferenced object 0xffff8881281723c0 (size 192):
comm "syz.0.19", pid 6098, jiffies 4294942685
hex dump (first 32 bytes):
2f 2f f2 2f 06 08 2f df 2f 6f dc ea 95 9a 82 10 //./.././o......
97 57 8f 37 98 9b 2f f9 0d 6d 44 94 29 55 db 15 .W.7../..mD.)U..
backtrace (crc 93bb458c):
kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
slab_post_alloc_hook mm/slub.c:4979 [inline]
slab_alloc_node mm/slub.c:5284 [inline]
__do_kmalloc_node mm/slub.c:5645 [inline]
__kmalloc_node_track_caller_noprof+0x3aa/0x6b0 mm/slub.c:5755
__kmemdup_nul mm/util.c:64 [inline]
kstrdup+0x3c/0x80 mm/util.c:84
smb3_fs_context_parse_param+0x229b/0x36c0 fs/smb/client/fs_context.c:1444
vfs_parse_fs_param+0xf4/0x190 fs/fs_context.c:146
vfs_fsconfig_locked fs/fsopen.c:303 [inline]
__do_sys_fsconfig+0x7d3/0x900 fs/fsopen.c:473
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xa4/0xfa0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
BUG: memory leak
unreferenced object 0xffff888128172c00 (size 192):
comm "syz.0.20", pid 6128, jiffies 4294943222
hex dump (first 32 bytes):
2f 2f f2 2f 06 08 2f df 2f 6f dc ea 95 9a 82 10 //./.././o......
97 57 8f 37 98 9b 2f f9 0d 6d 44 94 29 55 db 15 .W.7../..mD.)U..
backtrace (crc 93bb458c):
kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
slab_post_alloc_hook mm/slub.c:4979 [inline]
slab_alloc_node mm/slub.c:5284 [inline]
__do_kmalloc_node mm/slub.c:5645 [inline]
__kmalloc_noprof+0x3e3/0x6b0 mm/slub.c:5658
kmalloc_noprof include/linux/slab.h:961 [inline]
smb3_fs_context_fullpath+0x70/0x1b0 fs/smb/client/fs_context.c:629
smb3_fs_context_parse_param+0x2266/0x36c0 fs/smb/client/fs_context.c:1438
vfs_parse_fs_param+0xf4/0x190 fs/fs_context.c:146
vfs_fsconfig_locked fs/fsopen.c:303 [inline]
__do_sys_fsconfig+0x7d3/0x900 fs/fsopen.c:473
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xa4/0xfa0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
connection error: failed to recv *flatrpc.ExecutorMessageRawT: EOF
---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.
syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.
If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)
If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report
If you want to undo deduplication, reply with:
#syz undup
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [syzbot] [cifs?] memory leak in smb3_fs_context_fullpath
2025-11-13 4:26 [syzbot] [cifs?] memory leak in smb3_fs_context_fullpath syzbot
@ 2025-11-18 8:58 ` shaurya
2025-11-18 9:59 ` syzbot
2025-11-18 11:23 ` shaurya
2025-11-18 11:38 ` shaurya
2 siblings, 1 reply; 8+ messages in thread
From: shaurya @ 2025-11-18 8:58 UTC (permalink / raw)
To: syzbot+87be6809ed9bf6d718e3; +Cc: linux-cifs, linux-kernel, syzkaller-bugs
#syz test:
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
diff --git a/fs/smb/client/fs_context.c b/fs/smb/client/fs_context.c
index 0f894d09157b..975f1fa153fd 100644
--- a/fs/smb/client/fs_context.c
+++ b/fs/smb/client/fs_context.c
@@ -1834,6 +1834,12 @@ static int smb3_fs_context_parse_param(struct
fs_context *fc,
ctx->password = NULL;
kfree_sensitive(ctx->password2);
ctx->password2 = NULL;
+ kfree(ctx->source);
+ ctx->source = NULL;
+ if (fc) {
+ kfree(fc->source);
+ fc->source = NULL;
+ }
return -EINVAL;
}
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [syzbot] [cifs?] memory leak in smb3_fs_context_fullpath
2025-11-18 8:58 ` shaurya
@ 2025-11-18 9:59 ` syzbot
0 siblings, 0 replies; 8+ messages in thread
From: syzbot @ 2025-11-18 9:59 UTC (permalink / raw)
To: linux-cifs, linux-kernel, ssranevjti, syzkaller-bugs
Hello,
syzbot tried to test the proposed patch but the build/boot failed:
failed to apply patch:
checking file fs/smb/client/fs_context.c
patch: **** unexpected end of file in patch
Tested on:
commit: e7c375b1 Merge tag 'vfs-6.18-rc7.fixes' of gitolite.ke..
git tree: upstream
kernel config: https://syzkaller.appspot.com/x/.config?x=cb128cd5cb439809
dashboard link: https://syzkaller.appspot.com/bug?extid=87be6809ed9bf6d718e3
compiler:
patch: https://syzkaller.appspot.com/x/patch.diff?x=125ef212580000
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [syzbot] [cifs?] memory leak in smb3_fs_context_fullpath
2025-11-13 4:26 [syzbot] [cifs?] memory leak in smb3_fs_context_fullpath syzbot
2025-11-18 8:58 ` shaurya
@ 2025-11-18 11:23 ` shaurya
2025-11-18 11:30 ` Aleksandr Nogikh
2025-11-18 11:48 ` syzbot
2025-11-18 11:38 ` shaurya
2 siblings, 2 replies; 8+ messages in thread
From: shaurya @ 2025-11-18 11:23 UTC (permalink / raw)
To: syzbot+87be6809ed9bf6d718e3; +Cc: linux-cifs, linux-kernel, syzkaller-bugs
#syz test:
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
diff --git a/fs/smb/client/fs_context.c b/fs/smb/client/fs_context.c
index 0f894d09157b..975f1fa153fd 100644
--- a/fs/smb/client/fs_context.c
+++ b/fs/smb/client/fs_context.c
@@ -1834,6 +1834,12 @@ static int smb3_fs_context_parse_param(struct
fs_context *fc,
ctx->password = NULL;
kfree_sensitive(ctx->password2);
ctx->password2 = NULL;
+ kfree(ctx->source);
+ ctx->source = NULL;
+ if (fc) {
+ kfree(fc->source);
+ fc->source = NULL;
+ }
return -EINVAL;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [syzbot] [cifs?] memory leak in smb3_fs_context_fullpath
2025-11-18 11:23 ` shaurya
@ 2025-11-18 11:30 ` Aleksandr Nogikh
2025-11-18 11:48 ` syzbot
1 sibling, 0 replies; 8+ messages in thread
From: Aleksandr Nogikh @ 2025-11-18 11:30 UTC (permalink / raw)
To: shaurya
Cc: syzbot+87be6809ed9bf6d718e3, linux-cifs, linux-kernel,
syzkaller-bugs
On Tue, Nov 18, 2025 at 12:23 PM shaurya <ssranevjti@gmail.com> wrote:
>
> #syz test:
> git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>
> diff --git a/fs/smb/client/fs_context.c b/fs/smb/client/fs_context.c
> index 0f894d09157b..975f1fa153fd 100644
> --- a/fs/smb/client/fs_context.c
> +++ b/fs/smb/client/fs_context.c
> @@ -1834,6 +1834,12 @@ static int smb3_fs_context_parse_param(struct
> fs_context *fc,
Please note that your email client has line-wrapped the text, thus
breaking this git patch. It may be easier to just attach it as a file,
syzbot should understand it.
> ctx->password = NULL;
> kfree_sensitive(ctx->password2);
> ctx->password2 = NULL;
> + kfree(ctx->source);
> + ctx->source = NULL;
> + if (fc) {
> + kfree(fc->source);
> + fc->source = NULL;
> + }
> return -EINVAL;
> }
>
> --
> 2.34.1
>
> --
> You received this message because you are subscribed to the Google Groups "syzkaller-bugs" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller-bugs+unsubscribe@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/syzkaller-bugs/8831475d-0eeb-4107-ad87-c9c8736c219c%40gmail.com.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [syzbot] [cifs?] memory leak in smb3_fs_context_fullpath
2025-11-13 4:26 [syzbot] [cifs?] memory leak in smb3_fs_context_fullpath syzbot
2025-11-18 8:58 ` shaurya
2025-11-18 11:23 ` shaurya
@ 2025-11-18 11:38 ` shaurya
2025-11-18 12:10 ` syzbot
2 siblings, 1 reply; 8+ messages in thread
From: shaurya @ 2025-11-18 11:38 UTC (permalink / raw)
To: syzbot+87be6809ed9bf6d718e3; +Cc: linux-cifs, linux-kernel, syzkaller-bugs
[-- Attachment #1: Type: text/plain, Size: 84 bytes --]
#syz test:
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
[-- Attachment #2: cifs-fix.patch --]
[-- Type: text/x-patch, Size: 471 bytes --]
diff --git a/fs/smb/client/fs_context.c b/fs/smb/client/fs_context.c
index 0f894d09157b..975f1fa153fd 100644
--- a/fs/smb/client/fs_context.c
+++ b/fs/smb/client/fs_context.c
@@ -1834,6 +1834,12 @@ static int smb3_fs_context_parse_param(struct fs_context *fc,
ctx->password = NULL;
kfree_sensitive(ctx->password2);
ctx->password2 = NULL;
+ kfree(ctx->source);
+ ctx->source = NULL;
+ if (fc) {
+ kfree(fc->source);
+ fc->source = NULL;
+ }
return -EINVAL;
}
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [syzbot] [cifs?] memory leak in smb3_fs_context_fullpath
2025-11-18 11:23 ` shaurya
2025-11-18 11:30 ` Aleksandr Nogikh
@ 2025-11-18 11:48 ` syzbot
1 sibling, 0 replies; 8+ messages in thread
From: syzbot @ 2025-11-18 11:48 UTC (permalink / raw)
To: linux-cifs, linux-kernel, ssranevjti, syzkaller-bugs
Hello,
syzbot tried to test the proposed patch but the build/boot failed:
failed to apply patch:
checking file fs/smb/client/fs_context.c
patch: **** unexpected end of file in patch
Tested on:
commit: e7c375b1 Merge tag 'vfs-6.18-rc7.fixes' of gitolite.ke..
git tree: upstream
kernel config: https://syzkaller.appspot.com/x/.config?x=cb128cd5cb439809
dashboard link: https://syzkaller.appspot.com/bug?extid=87be6809ed9bf6d718e3
compiler:
patch: https://syzkaller.appspot.com/x/patch.diff?x=17661658580000
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [syzbot] [cifs?] memory leak in smb3_fs_context_fullpath
2025-11-18 11:38 ` shaurya
@ 2025-11-18 12:10 ` syzbot
0 siblings, 0 replies; 8+ messages in thread
From: syzbot @ 2025-11-18 12:10 UTC (permalink / raw)
To: linux-cifs, linux-kernel, ssranevjti, syzkaller-bugs
Hello,
syzbot has tested the proposed patch and the reproducer did not trigger any issue:
Reported-by: syzbot+87be6809ed9bf6d718e3@syzkaller.appspotmail.com
Tested-by: syzbot+87be6809ed9bf6d718e3@syzkaller.appspotmail.com
Tested on:
commit: e7c375b1 Merge tag 'vfs-6.18-rc7.fixes' of gitolite.ke..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1399f212580000
kernel config: https://syzkaller.appspot.com/x/.config?x=f30cc590c4f6da44
dashboard link: https://syzkaller.appspot.com/bug?extid=87be6809ed9bf6d718e3
compiler: gcc (Debian 12.2.0-14+deb12u1) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=1129f212580000
Note: testing is done by a robot and is best-effort only.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2025-11-18 12:10 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-13 4:26 [syzbot] [cifs?] memory leak in smb3_fs_context_fullpath syzbot
2025-11-18 8:58 ` shaurya
2025-11-18 9:59 ` syzbot
2025-11-18 11:23 ` shaurya
2025-11-18 11:30 ` Aleksandr Nogikh
2025-11-18 11:48 ` syzbot
2025-11-18 11:38 ` shaurya
2025-11-18 12:10 ` syzbot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox