[syzbot] [ntfs3?] kernel panic: stack is corrupted in vprintk_emit

66 views
Skip to first unread message

syzbot

unread,
Aug 16, 2024, 9:07:22 AM8/16/24
to almaz.ale...@paragon-software.com, linux-...@vger.kernel.org, nt...@lists.linux.dev, syzkall...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: d7a5aa4b3c00 Merge tag 'perf-tools-fixes-for-v6.11-2024-08..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1451b6d5980000
kernel config: https://syzkaller.appspot.com/x/.config?x=7229118d88b4a71b
dashboard link: https://syzkaller.appspot.com/bug?extid=4d2aaeff9eb5a2cfec70
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1450656b980000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1391c35d980000

Downloadable assets:
disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/7bc7510fe41f/non_bootable_disk-d7a5aa4b.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/af15738cca6c/vmlinux-d7a5aa4b.xz
kernel image: https://storage.googleapis.com/syzbot-assets/62dacb1384ee/bzImage-d7a5aa4b.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/9787f2a8ed93/mount_0.gz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+4d2aae...@syzkaller.appspotmail.com

ntfs3: loop0: Different NTFS sector size (1024) and media sector size (512).
ntfs3: loop0: Failed to load $UpCase (-22).
Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: vprintk_emit+0x764/0x770
CPU: 0 UID: 0 PID: 5459 Comm: syz-executor295 Not tainted 6.11.0-rc3-syzkaller-00156-gd7a5aa4b3c00 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:93 [inline]
dump_stack_lvl+0x241/0x360 lib/dump_stack.c:119
panic+0x349/0x860 kernel/panic.c:348
__stack_chk_fail+0x15/0x20 kernel/panic.c:821
vprintk_emit+0x764/0x770
_printk+0xd5/0x120 kernel/printk/printk.c:2373
ntfs_printk+0x3ad/0x420 fs/ntfs3/super.c:93
ntfs_fill_super+0x2eb8/0x4730
get_tree_bdev+0x3f7/0x570 fs/super.c:1635
vfs_get_tree+0x90/0x2a0 fs/super.c:1800
do_new_mount+0x2be/0xb40 fs/namespace.c:3472
do_mount fs/namespace.c:3812 [inline]
__do_sys_mount fs/namespace.c:4020 [inline]
__se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3997
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fb031d0492a
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 1e 09 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffce447eda8 EFLAGS: 00000286 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fb031d0492a
RDX: 000000002001f800 RSI: 000000002001f840 RDI: 00007ffce447edf0
RBP: 0000000000000004 R08: 00007ffce447ee30 R09: 000000000001f825
R10: 0000000000000801 R11: 0000000000000286 R12: 00007ffce447edf0
R13: 00007ffce447ee30 R14: 0000000000000003 R15: 0000000000200000
</TASK>
Kernel Offset: disabled
Rebooting in 86400 seconds..


---
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 syzk...@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

Edward Adam Davis

unread,
Aug 27, 2024, 3:27:30 AM8/27/24
to syzbot+4d2aae...@syzkaller.appspotmail.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
#syz test: upstream master

syzbot

unread,
Aug 27, 2024, 3:50:03 AM8/27/24
to ead...@qq.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
kernel panic: stack is corrupted in vprintk_emit

ntfs3: loop0: Failed to load $UpCase (-22).
Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: vprintk_emit+0x7bd/0x7c0
CPU: 0 UID: 0 PID: 5851 Comm: syz.0.15 Not tainted 6.11.0-rc5-syzkaller-00015-g3e9bff3bbe13 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:93 [inline]
dump_stack_lvl+0x241/0x360 lib/dump_stack.c:119
panic+0x349/0x860 kernel/panic.c:354
__stack_chk_fail+0x15/0x20 kernel/panic.c:827
vprintk_emit+0x7bd/0x7c0
_printk+0xd5/0x120 kernel/printk/printk.c:2373
ntfs_printk+0x3ad/0x420 fs/ntfs3/super.c:93
ntfs_fill_super+0x2eb8/0x4730
get_tree_bdev+0x3f7/0x570 fs/super.c:1635
vfs_get_tree+0x90/0x2b0 fs/super.c:1800
do_new_mount+0x2be/0xb40 fs/namespace.c:3472
do_mount fs/namespace.c:3812 [inline]
__do_sys_mount fs/namespace.c:4020 [inline]
__se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3997
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f6e3a57b0ba
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 7e 1a 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f6e3b384e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f6e3b384ef0 RCX: 00007f6e3a57b0ba
RDX: 000000002001f800 RSI: 000000002001f840 RDI: 00007f6e3b384eb0
RBP: 000000002001f800 R08: 00007f6e3b384ef0 R09: 0000000000000801
R10: 0000000000000801 R11: 0000000000000246 R12: 000000002001f840
R13: 00007f6e3b384eb0 R14: 000000000001f829 R15: 0000000020000000
</TASK>
Kernel Offset: disabled
Rebooting in 86400 seconds..


Tested on:

commit: 3e9bff3b Merge tag 'vfs-6.11-rc6.fixes' of gitolite.ke..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1362847b980000
kernel config: https://syzkaller.appspot.com/x/.config?x=8605cd35ddc8ff3c
dashboard link: https://syzkaller.appspot.com/bug?extid=4d2aaeff9eb5a2cfec70
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

Note: no patches were applied.

syzbot

unread,
Sep 2, 2024, 8:27:53 AM9/2/24
to linux-...@vger.kernel.org, syzkall...@googlegroups.com
For archival purposes, forwarding an incoming command email to
linux-...@vger.kernel.org, syzkall...@googlegroups.com.

***

Subject: possible fix (linux-ntfs3)
Author: almaz.ale...@paragon-software.com

#syz test: https://github.com/Paragon-Software-Group/linux-ntfs3.git master

diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c
index 128d49512f5d..c08bbacc0030 100644
--- a/fs/ntfs3/super.c
+++ b/fs/ntfs3/super.c
@@ -125,8 +125,9 @@ void ntfs_inode_printk(struct inode *inode, const
char *fmt, ...)

         if (de) {
             spin_lock(&de->d_lock);
-            snprintf(name, sizeof(s_name_buf), " \"%s\"",
-                 de->d_name.name);
+            if (snprintf(name, sizeof(s_name_buf), " \"%s\"",
+                     de->d_name.name) >= sizeof(s_name_buf))
+                name[sizeof(s_name_buf) - 1] = 0;
             spin_unlock(&de->d_lock);
         } else {
             name[0] = 0;


syzbot

unread,
Sep 2, 2024, 8:29:03 AM9/2/24
to almaz.ale...@paragon-software.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot tried to test the proposed patch but the build/boot failed:

failed to apply patch:
checking file fs/ntfs3/super.c
patch: **** unexpected end of file in patch



Tested on:

commit: 7529036a fs/ntfs3: Rename ntfs3_setattr into ntfs_seta..
git tree: https://github.com/Paragon-Software-Group/linux-ntfs3.git master
kernel config: https://syzkaller.appspot.com/x/.config?x=7229118d88b4a71b
patch: https://syzkaller.appspot.com/x/patch.diff?x=15523cc7980000

syzbot

unread,
Sep 2, 2024, 8:44:09 AM9/2/24
to linux-...@vger.kernel.org, syzkall...@googlegroups.com
For archival purposes, forwarding an incoming command email to
linux-...@vger.kernel.org, syzkall...@googlegroups.com.

***

Subject: possible fix 2 (linux-ntfs3)

syzbot

unread,
Sep 2, 2024, 8:45:55 AM9/2/24
to linux-...@vger.kernel.org, syzkall...@googlegroups.com
For archival purposes, forwarding an incoming command email to
linux-...@vger.kernel.org, syzkall...@googlegroups.com.

***

Subject: possible fix 2 (upstream)
Author: almaz.ale...@paragon-software.com

#syz test: upstream master

syzbot

unread,
Sep 2, 2024, 9:04:05 AM9/2/24
to almaz.ale...@paragon-software.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
kernel panic: stack is corrupted in vprintk_emit

loop0: detected capacity change from 0 to 4096
ntfs3: loop0: Different NTFS sector size (1024) and media sector size (512).
ntfs3: loop0: Failed to load $UpCase (-22).
Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: vprintk_emit+0x764/0x770
CPU: 0 UID: 0 PID: 6409 Comm: syz.0.233 Not tainted 6.11.0-rc1-syzkaller-00016-g7529036a025a-dirty #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:93 [inline]
dump_stack_lvl+0x241/0x360 lib/dump_stack.c:119
panic+0x349/0x860 kernel/panic.c:348
__stack_chk_fail+0x15/0x20 kernel/panic.c:821
vprintk_emit+0x764/0x770
_printk+0xd5/0x120 kernel/printk/printk.c:2373
ntfs_printk+0x3ad/0x420 fs/ntfs3/super.c:93
ntfs_fill_super+0x2eb8/0x4730
get_tree_bdev+0x3f7/0x570 fs/super.c:1635
vfs_get_tree+0x90/0x2a0 fs/super.c:1800
do_new_mount+0x2be/0xb40 fs/namespace.c:3472
do_mount fs/namespace.c:3812 [inline]
__do_sys_mount fs/namespace.c:4020 [inline]
__se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3997
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fcc9577b0ba
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 7e 1a 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fcc96519e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007fcc96519ef0 RCX: 00007fcc9577b0ba
RDX: 000000002001f800 RSI: 000000002001f840 RDI: 00007fcc96519eb0
RBP: 000000002001f800 R08: 00007fcc96519ef0 R09: 0000000000000801
R10: 0000000000000801 R11: 0000000000000246 R12: 000000002001f840
R13: 00007fcc96519eb0 R14: 000000000001f829 R15: 0000000020000000
</TASK>
Kernel Offset: disabled
Rebooting in 86400 seconds..


Tested on:

commit: 7529036a fs/ntfs3: Rename ntfs3_setattr into ntfs_seta..
git tree: https://github.com/Paragon-Software-Group/linux-ntfs3.git master
console output: https://syzkaller.appspot.com/x/log.txt?x=11819b0b980000
kernel config: https://syzkaller.appspot.com/x/.config?x=8b0cca2f3880513d
dashboard link: https://syzkaller.appspot.com/bug?extid=4d2aaeff9eb5a2cfec70
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=17a2ce0b980000

syzbot

unread,
Sep 2, 2024, 9:20:02 AM9/2/24
to almaz.ale...@paragon-software.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
kernel panic: stack is corrupted in vprintk_emit

loop0: detected capacity change from 0 to 4096
ntfs3: loop0: Different NTFS sector size (1024) and media sector size (512).
ntfs3: loop0: Failed to load $UpCase (-22).
Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: vprintk_emit+0x7bd/0x7c0
CPU: 0 UID: 0 PID: 6111 Comm: syz.0.139 Not tainted 6.11.0-rc6-syzkaller-g67784a74e258-dirty #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:93 [inline]
dump_stack_lvl+0x241/0x360 lib/dump_stack.c:119
panic+0x349/0x860 kernel/panic.c:354
__stack_chk_fail+0x15/0x20 kernel/panic.c:827
vprintk_emit+0x7bd/0x7c0
_printk+0xd5/0x120 kernel/printk/printk.c:2373
ntfs_printk+0x3ad/0x420 fs/ntfs3/super.c:93
ntfs_fill_super+0x2eb8/0x4730
get_tree_bdev+0x3f7/0x570 fs/super.c:1635
vfs_get_tree+0x90/0x2b0 fs/super.c:1800
do_new_mount+0x2be/0xb40 fs/namespace.c:3472
do_mount fs/namespace.c:3812 [inline]
__do_sys_mount fs/namespace.c:4020 [inline]
__se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3997
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f77a717b0ba
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 7e 1a 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f77a7f23e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f77a7f23ef0 RCX: 00007f77a717b0ba
RDX: 000000002001f800 RSI: 000000002001f840 RDI: 00007f77a7f23eb0
RBP: 000000002001f800 R08: 00007f77a7f23ef0 R09: 0000000000000801
R10: 0000000000000801 R11: 0000000000000246 R12: 000000002001f840
R13: 00007f77a7f23eb0 R14: 000000000001f829 R15: 0000000020000000
</TASK>
Kernel Offset: disabled
Rebooting in 86400 seconds..


Tested on:

commit: 67784a74 Merge tag 'ata-6.11-rc7' of git://git.kernel...
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1323d0c7980000
kernel config: https://syzkaller.appspot.com/x/.config?x=d34743b6e48523a6
dashboard link: https://syzkaller.appspot.com/bug?extid=4d2aaeff9eb5a2cfec70
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=125833db980000

syzbot

unread,
Sep 4, 2024, 10:18:04 AM9/4/24
to linux-...@vger.kernel.org, syzkall...@googlegroups.com
For archival purposes, forwarding an incoming command email to
linux-...@vger.kernel.org, syzkall...@googlegroups.com.

***

Subject: check
Author: almaz.ale...@paragon-software.com

#syz test: https://github.com/Paragon-Software-Group/linux-ntfs3.git master

diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c
index 128d49512f5d..a5df8f4c0150 100644
--- a/fs/ntfs3/super.c
+++ b/fs/ntfs3/super.c
@@ -1472,7 +1472,7 @@ static int ntfs_fill_super(struct super_block *sb,
struct fs_context *fc)
     inode = ntfs_iget5(sb, &ref, &NAME_UPCASE);
     if (IS_ERR(inode)) {
         err = PTR_ERR(inode);
-        ntfs_err(sb, "Failed to load $UpCase (%d).", err);
+        ntfs_err(sb, "Failed to load UpCase (%d).", err);
         goto out;
     }

syzbot

unread,
Sep 4, 2024, 10:19:03 AM9/4/24
to almaz.ale...@paragon-software.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot tried to test the proposed patch but the build/boot failed:

failed to apply patch:
checking file fs/ntfs3/super.c
Hunk #1 FAILED at 1472.
1 out of 1 hunk FAILED



Tested on:

commit: 689ecd06 fs/ntfs3: Rename ntfs3_setattr into ntfs_seta..
kernel config: https://syzkaller.appspot.com/x/.config?x=7229118d88b4a71b
patch: https://syzkaller.appspot.com/x/patch.diff?x=12041339980000

syzbot

unread,
Sep 4, 2024, 10:22:25 AM9/4/24
to linux-...@vger.kernel.org, syzkall...@googlegroups.com

syzbot

unread,
Sep 4, 2024, 10:37:04 AM9/4/24
to almaz.ale...@paragon-software.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
kernel panic: stack is corrupted in vprintk_emit

ntfs3: loop0: Different NTFS sector size (1024) and media sector size (512).
ntfs3: loop0: Failed to load UpCase (-22).
Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: vprintk_emit+0x764/0x770
CPU: 0 UID: 0 PID: 5705 Comm: syz.0.15 Not tainted 6.11.0-rc1-syzkaller-00017-g689ecd06ef8d-dirty #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:93 [inline]
dump_stack_lvl+0x241/0x360 lib/dump_stack.c:119
panic+0x349/0x860 kernel/panic.c:348
__stack_chk_fail+0x15/0x20 kernel/panic.c:821
vprintk_emit+0x764/0x770
_printk+0xd5/0x120 kernel/printk/printk.c:2373
ntfs_printk+0x3ad/0x420 fs/ntfs3/super.c:93
ntfs_fill_super+0x2eb8/0x4730
get_tree_bdev+0x3f7/0x570 fs/super.c:1635
vfs_get_tree+0x90/0x2a0 fs/super.c:1800
do_new_mount+0x2be/0xb40 fs/namespace.c:3472
do_mount fs/namespace.c:3812 [inline]
__do_sys_mount fs/namespace.c:4020 [inline]
__se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3997
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fc24b57b0ba
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 7e 1a 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fc24c381e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007fc24c381ef0 RCX: 00007fc24b57b0ba
RDX: 000000002001f800 RSI: 000000002001f840 RDI: 00007fc24c381eb0
RBP: 000000002001f800 R08: 00007fc24c381ef0 R09: 0000000000000801
R10: 0000000000000801 R11: 0000000000000246 R12: 000000002001f840
R13: 00007fc24c381eb0 R14: 000000000001f829 R15: 0000000020000000
</TASK>
Kernel Offset: disabled
Rebooting in 86400 seconds..


Tested on:

commit: 689ecd06 fs/ntfs3: Rename ntfs3_setattr into ntfs_seta..
git tree: https://github.com/Paragon-Software-Group/linux-ntfs3.git master
console output: https://syzkaller.appspot.com/x/log.txt?x=12273163980000
kernel config: https://syzkaller.appspot.com/x/.config?x=8b0cca2f3880513d
dashboard link: https://syzkaller.appspot.com/bug?extid=4d2aaeff9eb5a2cfec70
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=15d41fdb980000

syzbot

unread,
Sep 10, 2024, 3:08:02 AM9/10/24
to linux-...@vger.kernel.org, syzkall...@googlegroups.com
For archival purposes, forwarding an incoming command email to
linux-...@vger.kernel.org, syzkall...@googlegroups.com.

***

Subject: possible fix (linux-ntfs3)
Author: almaz.ale...@paragon-software.com

#syz test: https://github.com/Paragon-Software-Group/linux-ntfs3.git master

diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c
index 128d49512f5d..4a2062e481a4 100644
--- a/fs/ntfs3/super.c
+++ b/fs/ntfs3/super.c
@@ -124,10 +124,15 @@ void ntfs_inode_printk(struct inode *inode, const char *fmt, ...)
struct dentry *de = d_find_alias(inode);

if (de) {
+ int len;
spin_lock(&de->d_lock);
- snprintf(name, sizeof(s_name_buf), " \"%s\"",
- de->d_name.name);
+ len = snprintf(name, sizeof(s_name_buf), " \"%s\"",
+ de->d_name.name);
spin_unlock(&de->d_lock);
+ if (len <= 0)
+ name[0] = 0;
+ else if (len >= sizeof(s_name_buf))
+ name[sizeof(s_name_buf) - 1] = 0;

syzbot

unread,
Sep 10, 2024, 3:25:07 AM9/10/24
to almaz.ale...@paragon-software.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
kernel panic: stack is corrupted in vprintk_emit

loop0: detected capacity change from 0 to 4096
ntfs3: loop0: Different NTFS sector size (1024) and media sector size (512).
ntfs3: loop0: Failed to load $UpCase (-22).
Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: vprintk_emit+0x764/0x770
CPU: 0 UID: 0 PID: 6009 Comm: syz.0.65 Not tainted 6.11.0-rc1-syzkaller-00017-g689ecd06ef8d-dirty #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:93 [inline]
dump_stack_lvl+0x241/0x360 lib/dump_stack.c:119
panic+0x349/0x860 kernel/panic.c:348
__stack_chk_fail+0x15/0x20 kernel/panic.c:821
vprintk_emit+0x764/0x770
_printk+0xd5/0x120 kernel/printk/printk.c:2373
ntfs_printk+0x3ad/0x420 fs/ntfs3/super.c:93
ntfs_fill_super+0x2eb8/0x4730
get_tree_bdev+0x3f7/0x570 fs/super.c:1635
vfs_get_tree+0x90/0x2a0 fs/super.c:1800
do_new_mount+0x2be/0xb40 fs/namespace.c:3472
do_mount fs/namespace.c:3812 [inline]
__do_sys_mount fs/namespace.c:4020 [inline]
__se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3997
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f1fc857b0ba
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 7e 1a 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f1fc934be68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f1fc934bef0 RCX: 00007f1fc857b0ba
RDX: 000000002001f800 RSI: 000000002001f840 RDI: 00007f1fc934beb0
RBP: 000000002001f800 R08: 00007f1fc934bef0 R09: 0000000000000801
R10: 0000000000000801 R11: 0000000000000246 R12: 000000002001f840
R13: 00007f1fc934beb0 R14: 000000000001f829 R15: 0000000020000000
</TASK>
Kernel Offset: disabled
Rebooting in 86400 seconds..


Tested on:

commit: 689ecd06 fs/ntfs3: Rename ntfs3_setattr into ntfs_seta..
git tree: https://github.com/Paragon-Software-Group/linux-ntfs3.git master
console output: https://syzkaller.appspot.com/x/log.txt?x=15632a8b980000
kernel config: https://syzkaller.appspot.com/x/.config?x=8b0cca2f3880513d
dashboard link: https://syzkaller.appspot.com/bug?extid=4d2aaeff9eb5a2cfec70
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=1025a807980000

syzbot

unread,
Jan 14, 2025, 3:52:16 AM1/14/25
to syzkall...@googlegroups.com
Auto-closing this bug as obsolete.
No recent activity, existing reproducers are no longer triggering the issue.
Reply all
Reply to author
Forward
0 new messages