2021-04-09 18:00:58

by syzbot

[permalink] [raw]
Subject: [syzbot] BUG: spinlock bad magic in erofs_pcpubuf_growsize

Hello,

syzbot found the following issue on:

HEAD commit: 9c54130c Add linux-next specific files for 20210406
git tree: linux-next
console output: https://syzkaller.appspot.com/x/log.txt?x=1654617ed00000
kernel config: https://syzkaller.appspot.com/x/.config?x=d125958c3995ddcd
dashboard link: https://syzkaller.appspot.com/bug?extid=d6a0e4b80bd39f54c2f6
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=101a5786d00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1147dd0ed00000

The issue was bisected to:

commit 997acaf6b4b59c6a9c259740312a69ea549cc684
Author: Mark Rutland <[email protected]>
Date: Mon Jan 11 15:37:07 2021 +0000

lockdep: report broken irq restoration

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=11d8d7aad00000
final oops: https://syzkaller.appspot.com/x/report.txt?x=13d8d7aad00000
console output: https://syzkaller.appspot.com/x/log.txt?x=15d8d7aad00000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: [email protected]
Fixes: 997acaf6b4b5 ("lockdep: report broken irq restoration")

loop0: detected capacity change from 0 to 31
BUG: spinlock bad magic on CPU#1, syz-executor062/8434
lock: 0xffff8880b9c31d60, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0
CPU: 1 PID: 8434 Comm: syz-executor062 Not tainted 5.12.0-rc6-next-20210406-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:79 [inline]
dump_stack+0x141/0x1d7 lib/dump_stack.c:120
debug_spin_lock_before kernel/locking/spinlock_debug.c:83 [inline]
do_raw_spin_lock+0x216/0x2b0 kernel/locking/spinlock_debug.c:112
erofs_pcpubuf_growsize+0x36f/0x620 fs/erofs/pcpubuf.c:83
z_erofs_load_lz4_config+0x1ef/0x3e0 fs/erofs/decompressor.c:64
erofs_read_superblock fs/erofs/super.c:331 [inline]
erofs_fc_fill_super+0xe84/0x1d10 fs/erofs/super.c:499
get_tree_bdev+0x440/0x760 fs/super.c:1293
vfs_get_tree+0x89/0x2f0 fs/super.c:1498
do_new_mount fs/namespace.c:2905 [inline]
path_mount+0x132a/0x1fa0 fs/namespace.c:3235
do_mount fs/namespace.c:3248 [inline]
__do_sys_mount fs/namespace.c:3456 [inline]
__se_sys_mount fs/namespace.c:3433 [inline]
__x64_sys_mount+0x27f/0x300 fs/namespace.c:3433
do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x444f7a
Code: 83 c4 08 5b 5d c3 66 2e 0f 1f 84 00 00 00 00 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffe1fa3c2a8 EFLAGS: 00000286 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007ffe1fa3c300 RCX: 0000000000444f7a
RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007ffe1fa3c2c0
RBP: 00007ffe1fa3c2c0 R08: 00007ffe1fa3c300 R09:


---
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 [email protected].

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
For information about bisection process see: https://goo.gl/tpsmEJ#bisection
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches


2021-04-09 18:17:29

by Gao Xiang

[permalink] [raw]
Subject: Re: [syzbot] BUG: spinlock bad magic in erofs_pcpubuf_growsize

Hi,

On Fri, Apr 09, 2021 at 10:59:15AM -0700, syzbot wrote:
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: 9c54130c Add linux-next specific files for 20210406
> git tree: linux-next
> console output: https://syzkaller.appspot.com/x/log.txt?x=1654617ed00000
> kernel config: https://syzkaller.appspot.com/x/.config?x=d125958c3995ddcd
> dashboard link: https://syzkaller.appspot.com/bug?extid=d6a0e4b80bd39f54c2f6
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=101a5786d00000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1147dd0ed00000
>
> The issue was bisected to:
>
> commit 997acaf6b4b59c6a9c259740312a69ea549cc684
> Author: Mark Rutland <[email protected]>
> Date: Mon Jan 11 15:37:07 2021 +0000
>
> lockdep: report broken irq restoration
>
> bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=11d8d7aad00000
> final oops: https://syzkaller.appspot.com/x/report.txt?x=13d8d7aad00000
> console output: https://syzkaller.appspot.com/x/log.txt?x=15d8d7aad00000
>
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: [email protected]
> Fixes: 997acaf6b4b5 ("lockdep: report broken irq restoration")
>
> loop0: detected capacity change from 0 to 31
> BUG: spinlock bad magic on CPU#1, syz-executor062/8434
> lock: 0xffff8880b9c31d60, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0
> CPU: 1 PID: 8434 Comm: syz-executor062 Not tainted 5.12.0-rc6-next-20210406-syzkaller #0
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
> Call Trace:
> __dump_stack lib/dump_stack.c:79 [inline]
> dump_stack+0x141/0x1d7 lib/dump_stack.c:120
> debug_spin_lock_before kernel/locking/spinlock_debug.c:83 [inline]
> do_raw_spin_lock+0x216/0x2b0 kernel/locking/spinlock_debug.c:112
> erofs_pcpubuf_growsize+0x36f/0x620 fs/erofs/pcpubuf.c:83
> z_erofs_load_lz4_config+0x1ef/0x3e0 fs/erofs/decompressor.c:64
> erofs_read_superblock fs/erofs/super.c:331 [inline]
> erofs_fc_fill_super+0xe84/0x1d10 fs/erofs/super.c:499
> get_tree_bdev+0x440/0x760 fs/super.c:1293
> vfs_get_tree+0x89/0x2f0 fs/super.c:1498
> do_new_mount fs/namespace.c:2905 [inline]
> path_mount+0x132a/0x1fa0 fs/namespace.c:3235
> do_mount fs/namespace.c:3248 [inline]
> __do_sys_mount fs/namespace.c:3456 [inline]
> __se_sys_mount fs/namespace.c:3433 [inline]
> __x64_sys_mount+0x27f/0x300 fs/namespace.c:3433
> do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
> entry_SYSCALL_64_after_hwframe+0x44/0xae
> RIP: 0033:0x444f7a
> Code: 83 c4 08 5b 5d c3 66 2e 0f 1f 84 00 00 00 00 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
> RSP: 002b:00007ffe1fa3c2a8 EFLAGS: 00000286 ORIG_RAX: 00000000000000a5
> RAX: ffffffffffffffda RBX: 00007ffe1fa3c300 RCX: 0000000000444f7a
> RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007ffe1fa3c2c0
> RBP: 00007ffe1fa3c2c0 R08: 00007ffe1fa3c300 R09:
>

Thanks for the report. It's a spinlock uninitialization issue actually
due to the new patchset (bisect was wrong here), I will fix it up soon.

Thanks,
Gao Xiang

2023-04-10 09:27:09

by Gao Xiang

[permalink] [raw]
Subject: Re: [syzbot] BUG: spinlock bad magic in erofs_pcpubuf_growsize

(avoid Cc such many people...)

On 2021/4/10 01:59, syzbot wrote:
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: 9c54130c Add linux-next specific files for 20210406
> git tree: linux-next
> console output: https://syzkaller.appspot.com/x/log.txt?x=1654617ed00000
> kernel config: https://syzkaller.appspot.com/x/.config?x=d125958c3995ddcd
> dashboard link: https://syzkaller.appspot.com/bug?extid=d6a0e4b80bd39f54c2f6
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=101a5786d00000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1147dd0ed00000
>
> The issue was bisected to:
>
> commit 997acaf6b4b59c6a9c259740312a69ea549cc684
> Author: Mark Rutland <[email protected]>
> Date: Mon Jan 11 15:37:07 2021 +0000
>
> lockdep: report broken irq restoration
>
> bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=11d8d7aad00000
> final oops: https://syzkaller.appspot.com/x/report.txt?x=13d8d7aad00000
> console output: https://syzkaller.appspot.com/x/log.txt?x=15d8d7aad00000
>
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: [email protected]
> Fixes: 997acaf6b4b5 ("lockdep: report broken irq restoration")
>
> loop0: detected capacity change from 0 to 31
> BUG: spinlock bad magic on CPU#1, syz-executor062/8434
> lock: 0xffff8880b9c31d60, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0
> CPU: 1 PID: 8434 Comm: syz-executor062 Not tainted 5.12.0-rc6-next-20210406-syzkaller #0
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
> Call Trace:
> __dump_stack lib/dump_stack.c:79 [inline]
> dump_stack+0x141/0x1d7 lib/dump_stack.c:120
> debug_spin_lock_before kernel/locking/spinlock_debug.c:83 [inline]
> do_raw_spin_lock+0x216/0x2b0 kernel/locking/spinlock_debug.c:112
> erofs_pcpubuf_growsize+0x36f/0x620 fs/erofs/pcpubuf.c:83

This issue only existed in some linux-next (2021/04/06 ~ 2021/04/06) and
Linux upstream never hitted such issue, so:

#syz test: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/ v6.3-rc6

#syz invalid

Thanks,
Gao Xiang

> z_erofs_load_lz4_config+0x1ef/0x3e0 fs/erofs/decompressor.c:64
> erofs_read_superblock fs/erofs/super.c:331 [inline]
> erofs_fc_fill_super+0xe84/0x1d10 fs/erofs/super.c:499
> get_tree_bdev+0x440/0x760 fs/super.c:1293
> vfs_get_tree+0x89/0x2f0 fs/super.c:1498
> do_new_mount fs/namespace.c:2905 [inline]
> path_mount+0x132a/0x1fa0 fs/namespace.c:3235
> do_mount fs/namespace.c:3248 [inline]
> __do_sys_mount fs/namespace.c:3456 [inline]
> __se_sys_mount fs/namespace.c:3433 [inline]
> __x64_sys_mount+0x27f/0x300 fs/namespace.c:3433
> do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
> entry_SYSCALL_64_after_hwframe+0x44/0xae
> RIP: 0033:0x444f7a
> Code: 83 c4 08 5b 5d c3 66 2e 0f 1f 84 00 00 00 00 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
> RSP: 002b:00007ffe1fa3c2a8 EFLAGS: 00000286 ORIG_RAX: 00000000000000a5
> RAX: ffffffffffffffda RBX: 00007ffe1fa3c300 RCX: 0000000000444f7a
> RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007ffe1fa3c2c0
> RBP: 00007ffe1fa3c2c0 R08: 00007ffe1fa3c300 R09:
>
>
> ---
> 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 [email protected].
>
> syzbot will keep track of this issue. See:
> https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
> For information about bisection process see: https://goo.gl/tpsmEJ#bisection
> syzbot can test patches for this issue, for details see:
> https://goo.gl/tpsmEJ#testing-patches
>

2023-04-10 09:45:01

by syzbot

[permalink] [raw]
Subject: Re: [syzbot] [erofs?] BUG: spinlock bad magic in erofs_pcpubuf_growsize

Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: [email protected]

Tested on:

commit: 09a9639e Linux 6.3-rc6
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/ v6.3-rc6
console output: https://syzkaller.appspot.com/x/log.txt?x=12cc39abc80000
kernel config: https://syzkaller.appspot.com/x/.config?x=c47e989e3f0f1947
dashboard link: https://syzkaller.appspot.com/bug?extid=d6a0e4b80bd39f54c2f6
compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2

Note: no patches were applied.
Note: testing is done by a robot and is best-effort only.

2023-04-10 09:52:42

by Gao Xiang

[permalink] [raw]
Subject: Re: [syzbot] [erofs?] BUG: spinlock bad magic in erofs_pcpubuf_growsize



On 2023/4/10 17:43, syzbot wrote:
> Hello,
>
> syzbot has tested the proposed patch and the reproducer did not trigger any issue:
>
> Reported-and-tested-by: [email protected]
>
> Tested on:
>
> commit: 09a9639e Linux 6.3-rc6
> git tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/ v6.3-rc6
> console output: https://syzkaller.appspot.com/x/log.txt?x=12cc39abc80000
> kernel config: https://syzkaller.appspot.com/x/.config?x=c47e989e3f0f1947
> dashboard link: https://syzkaller.appspot.com/bug?extid=d6a0e4b80bd39f54c2f6
> compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
>
> Note: no patches were applied.
> Note: testing is done by a robot and is best-effort only.

#syz invalid