BUG: corrupted list in process_one_work

27 views
Skip to first unread message

syzbot

unread,
Apr 10, 2022, 2:05:28 AM4/10/22
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 414e6c8e941c ANDROID: fix up abi issue with struct snd_pcm..
git tree: android12-5.10-lts
console output: https://syzkaller.appspot.com/x/log.txt?x=10f1fe18f00000
kernel config: https://syzkaller.appspot.com/x/.config?x=19b81eb0d2d939d9
dashboard link: https://syzkaller.appspot.com/bug?extid=badfd07a93cffefd7317
compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=17ea62a8f00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10a3ea24f00000

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

list_del corruption. next->prev should be ffffffff862f6c48, but was ffff8881f715c060
------------[ cut here ]------------
kernel BUG at lib/list_debug.c:56!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 24 Comm: kworker/1:1 Not tainted 5.10.109-syzkaller-00693-g414e6c8e941c #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: events destroy_list_workfn

RIP: 0010:__list_del_entry_valid+0xf9/0x100 lib/list_debug.c:54
Code: 7a d3 3f 02 0f 0b 48 c7 c7 e0 ca 43 85 4c 89 f6 31 c0 e8 67 d3 3f 02 0f 0b 48 c7 c7 40 cb 43 85 4c 89 f6 31 c0 e8 54 d3 3f 02 <0f> 0b 0f 1f 44 00 00 55 48 89 e5 be 08 00 00 00 48 c7 c7 20 d2 54
RSP: 0018:ffffc9000019fcf8 EFLAGS: 00010046

RAX: 0000000000000054 RBX: ffff8881061e2c78 RCX: 004ae6d477344a00
RDX: 0000000000000000 RSI: 0000000080000001 RDI: 0000000000000000
RBP: ffffc9000019fd18 R08: ffffffff8153b3c8 R09: ffffed103ee2a5d8
R10: ffffed103ee2a5d8 R11: 1ffff1103ee2a5d7 R12: dffffc0000000000
R13: ffffffff862f6c48 R14: ffffffff862f6c48 R15: ffff8881f7155720
FS: 0000000000000000(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fb511cfb2f0 CR3: 00000001069bd000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
__list_del_entry include/linux/list.h:132 [inline]
list_del_init include/linux/list.h:204 [inline]
process_one_work+0x445/0xc10 kernel/workqueue.c:2240
worker_thread+0xb27/0x1550 kernel/workqueue.c:2442
kthread+0x349/0x3d0 kernel/kthread.c:313
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296
Modules linked in:

---[ end trace 38d67c29ca1c8c64 ]---
RIP: 0010:__list_del_entry_valid+0xf9/0x100 lib/list_debug.c:54
Code: 7a d3 3f 02 0f 0b 48 c7 c7 e0 ca 43 85 4c 89 f6 31 c0 e8 67 d3 3f 02 0f 0b 48 c7 c7 40 cb 43 85 4c 89 f6 31 c0 e8 54 d3 3f 02 <0f> 0b 0f 1f 44 00 00 55 48 89 e5 be 08 00 00 00 48 c7 c7 20 d2 54
RSP: 0018:ffffc9000019fcf8 EFLAGS: 00010046

RAX: 0000000000000054 RBX: ffff8881061e2c78 RCX: 004ae6d477344a00
RDX: 0000000000000000 RSI: 0000000080000001 RDI: 0000000000000000
RBP: ffffc9000019fd18 R08: ffffffff8153b3c8 R09: ffffed103ee2a5d8
R10: ffffed103ee2a5d8 R11: 1ffff1103ee2a5d7 R12: dffffc0000000000
R13: ffffffff862f6c48 R14: ffffffff862f6c48 R15: ffff8881f7155720
FS: 0000000000000000(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fb511cfb2f0 CR3: 00000001069bd000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400


---
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.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches

Tadeusz Struk

unread,
Apr 11, 2022, 10:21:55 AM4/11/22
to syzbot, syzkaller-a...@googlegroups.com

syzbot

unread,
Apr 11, 2022, 12:12:10 PM4/11/22
to syzkaller-a...@googlegroups.com, tadeus...@linaro.org
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
BUG: corrupted list in insert_work

list_add corruption. prev->next should be next (ffff8881f733cb68), but was ffff888120d93c70. (prev=ffff888120d93c70).
------------[ cut here ]------------
kernel BUG at lib/list_debug.c:28!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 468 Comm: syz-executor154 Not tainted 5.18.0-rc2-syzkaller-00411-gce522ba9ef7e #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:__list_add_valid+0xc6/0xd0 lib/list_debug.c:26
Code: 48 c7 c7 c0 18 68 85 4c 89 e6 4c 89 f1 31 c0 e8 a0 bd 55 02 0f 0b 48 c7 c7 80 19 68 85 4c 89 f6 4c 89 e1 31 c0 e8 8a bd 55 02 <0f> 0b 0f 1f 84 00 00 00 00 00 55 48 89 e5 41 57 41 56 41 54 53 49
RSP: 0018:ffffc900001809b8 EFLAGS: 00010046
RAX: 0000000000000075 RBX: ffff8881f733cb70 RCX: 6c75837fc12d9a00
RDX: 0000000000000102 RSI: 0000000000000102 RDI: 0000000000000000
RBP: ffffc900001809e0 R08: ffffffff8157ac48 R09: ffffed103ee665d1
R10: ffffed103ee665d1 R11: 1ffff1103ee665d0 R12: ffff888120d93c70
R13: dffffc0000000000 R14: ffff8881f733cb68 R15: ffff888120d93c70
FS: 00005555574d6300(0000) GS:ffff8881f7300000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f4819e1f130 CR3: 0000000120d5d000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<IRQ>
__list_add include/linux/list.h:69 [inline]
list_add_tail include/linux/list.h:102 [inline]
insert_work+0x104/0x320 kernel/workqueue.c:1362
__queue_work+0x960/0xd20 kernel/workqueue.c:1517
queue_work_on+0xf2/0x170 kernel/workqueue.c:1545
queue_work include/linux/workqueue.h:502 [inline]
css_release+0xae/0xc0 kernel/cgroup/cgroup.c:5214
percpu_ref_put_many include/linux/percpu-refcount.h:335 [inline]
percpu_ref_put include/linux/percpu-refcount.h:351 [inline]
percpu_ref_call_confirm_rcu lib/percpu-refcount.c:163 [inline]
percpu_ref_switch_to_atomic_rcu+0x60d/0x620 lib/percpu-refcount.c:205
rcu_do_batch+0x507/0xbc0 kernel/rcu/tree.c:2535
rcu_core+0x4dc/0xef0 kernel/rcu/tree.c:2786
rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2803
__do_softirq+0x24e/0x586 kernel/softirq.c:558
invoke_softirq+0x70/0xd0 kernel/softirq.c:432
__irq_exit_rcu+0x4f/0xb0 kernel/softirq.c:637
irq_exit_rcu+0x9/0x10 kernel/softirq.c:649
sysvec_apic_timer_interrupt+0x9a/0xc0 arch/x86/kernel/apic/apic.c:1097
</IRQ>
<TASK>
asm_sysvec_apic_timer_interrupt+0x12/0x20
RIP: 0010:console_unlock+0xbf9/0x11b0 kernel/printk/printk.c:2779
Code: 00 48 81 e3 00 02 00 00 75 17 e8 62 e6 18 00 45 84 ff 74 1c e9 fe 04 00 00 0f 1f 84 00 00 00 00 00 e8 4b e6 18 00 fb 45 84 ff <0f> 85 e7 04 00 00 48 c7 c7 60 fb 0d 86 be 04 00 00 00 e8 f0 9d 57
RSP: 0018:ffffc9000168f260 EFLAGS: 00000246
RAX: ffffffff8157a5d5 RBX: 0000000000000200 RCX: ffff88810cf7b240
RDX: 0000000000000000 RSI: 0000000000000200 RDI: 0000000000000000
RBP: ffffc9000168f4b0 R08: ffffffff8157a5b0 R09: 0000000000000003
R10: fffff520002d1e3d R11: 1ffff920002d1e3c R12: ffffffff863fa208
R13: ffffc9000168f420 R14: dffffc0000000000 R15: 0000000000000000
vprintk_emit+0x141/0x440 kernel/printk/printk.c:2272
vprintk_default+0x26/0x30 kernel/printk/printk.c:2283
vprintk+0x86/0x90 kernel/printk/printk_safe.c:50
_printk+0xcf/0x10f kernel/printk/printk.c:2293
fail_dump lib/fault-inject.c:45 [inline]
should_fail+0x398/0x510 lib/fault-inject.c:146
__should_failslab+0x9f/0xe0 mm/failslab.c:33
should_failslab+0x9/0x20 mm/slab_common.c:1304
slab_pre_alloc_hook mm/slab.h:724 [inline]
slab_alloc_node mm/slub.c:3131 [inline]
slab_alloc mm/slub.c:3225 [inline]
kmem_cache_alloc_trace+0x4a/0x320 mm/slub.c:3256
kmalloc include/linux/slab.h:581 [inline]
kzalloc include/linux/slab.h:714 [inline]
percpu_ref_init+0xc9/0x350 lib/percpu-refcount.c:76
css_create kernel/cgroup/cgroup.c:5312 [inline]
cgroup_apply_control_enable+0x383/0x10c0 kernel/cgroup/cgroup.c:3124
cgroup_apply_control+0x93/0x710 kernel/cgroup/cgroup.c:3206
cgroup_subtree_control_write+0xdde/0x1340 kernel/cgroup/cgroup.c:3364
cgroup_file_write+0x28e/0x590 kernel/cgroup/cgroup.c:3882
kernfs_fop_write_iter+0x2cd/0x410 fs/kernfs/file.c:291
call_write_iter include/linux/fs.h:2050 [inline]
new_sync_write fs/read_write.c:504 [inline]
vfs_write+0xbb4/0xf30 fs/read_write.c:591
ksys_write+0x198/0x2c0 fs/read_write.c:644
__do_sys_write fs/read_write.c:656 [inline]
__se_sys_write fs/read_write.c:653 [inline]
__x64_sys_write+0x7b/0x90 fs/read_write.c:653
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x2f/0x50 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f4819da6ae9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 81 15 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 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:00007fff8dc409a8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f4819da6ae9
RDX: 0000000000000006 RSI: 0000000020000140 RDI: 0000000000000004
RBP: 00007fff8dc409d0 R08: 0000000000000001 R09: 00007fff8dc409e0
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000005
R13: 00007fff8dc409f0 R14: 00007fff8dc40a30 R15: 0000000000000006
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:__list_add_valid+0xc6/0xd0 lib/list_debug.c:26
Code: 48 c7 c7 c0 18 68 85 4c 89 e6 4c 89 f1 31 c0 e8 a0 bd 55 02 0f 0b 48 c7 c7 80 19 68 85 4c 89 f6 4c 89 e1 31 c0 e8 8a bd 55 02 <0f> 0b 0f 1f 84 00 00 00 00 00 55 48 89 e5 41 57 41 56 41 54 53 49
RSP: 0018:ffffc900001809b8 EFLAGS: 00010046
RAX: 0000000000000075 RBX: ffff8881f733cb70 RCX: 6c75837fc12d9a00
RDX: 0000000000000102 RSI: 0000000000000102 RDI: 0000000000000000
RBP: ffffc900001809e0 R08: ffffffff8157ac48 R09: ffffed103ee665d1
R10: ffffed103ee665d1 R11: 1ffff1103ee665d0 R12: ffff888120d93c70
R13: dffffc0000000000 R14: ffff8881f733cb68 R15: ffff888120d93c70
FS: 00005555574d6300(0000) GS:ffff8881f7300000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f4819e1f130 CR3: 0000000120d5d000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
0: 00 48 81 add %cl,-0x7f(%rax)
3: e3 00 jrcxz 0x5
5: 02 00 add (%rax),%al
7: 00 75 17 add %dh,0x17(%rbp)
a: e8 62 e6 18 00 callq 0x18e671
f: 45 84 ff test %r15b,%r15b
12: 74 1c je 0x30
14: e9 fe 04 00 00 jmpq 0x517
19: 0f 1f 84 00 00 00 00 nopl 0x0(%rax,%rax,1)
20: 00
21: e8 4b e6 18 00 callq 0x18e671
26: fb sti
27: 45 84 ff test %r15b,%r15b
* 2a: 0f 85 e7 04 00 00 jne 0x517 <-- trapping instruction
30: 48 c7 c7 60 fb 0d 86 mov $0xffffffff860dfb60,%rdi
37: be 04 00 00 00 mov $0x4,%esi
3c: e8 .byte 0xe8
3d: f0 9d lock popfq
3f: 57 push %rdi


Tested on:

commit: ce522ba9 Linux 5.18-rc2
git tree: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
console output: https://syzkaller.appspot.com/x/log.txt?x=125a058f700000
kernel config: https://syzkaller.appspot.com/x/.config?x=e5c1703829c231c4
dashboard link: https://syzkaller.appspot.com/bug?extid=badfd07a93cffefd7317
compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2

Note: no patches were applied.

syzbot

unread,
Aug 2, 2022, 7:24:09 PM8/2/22
to syzkaller-a...@googlegroups.com, tadeus...@linaro.org
syzbot suspects this issue was fixed by commit:

commit d007f49ab789bee8ed76021830b49745d5feaf61
Author: Al Viro <vi...@zeniv.linux.org.uk>
Date: Wed May 18 06:13:40 2022 +0000

percpu_ref_init(): clean ->percpu_count_ref on failure

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=179cacb6080000
start commit: 414e6c8e941c ANDROID: fix up abi issue with struct snd_pcm..
git tree: android12-5.10-lts
If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: percpu_ref_init(): clean ->percpu_count_ref on failure

For information about bisection process see: https://goo.gl/tpsmEJ#bisection
Reply all
Reply to author
Forward
0 new messages