BUG: corrupted list in free_block

9 views
Skip to first unread message

syzbot

unread,
Jan 7, 2019, 4:49:06 AM1/7/19
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: b5aef86e089a Merge tag 'docs-5.0-fixes' of git://git.lwn.n..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=16b1a44f400000
kernel config: https://syzkaller.appspot.com/x/.config?x=d55557b516c45456
dashboard link: https://syzkaller.appspot.com/bug?extid=db65e4a770078362ada3
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
CC: [gre...@linuxfoundation.org jsl...@suse.com
linux-...@vger.kernel.org]

Unfortunately, I don't have any reproducer for this crash yet.

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

Enabling of bearer <udp:syz0> rejected, already enabled
list_del corruption, ffffea0000f33bc8->next is LIST_POISON1
(dead000000000100)
------------[ cut here ]------------
kernel BUG at lib/list_debug.c:45!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 7418 Comm: kworker/1:3 Not tainted 4.20.0+ #12
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
kobject: 'loop1' (00000000022d321d): kobject_uevent_env
Workqueue: events cache_reap
RIP: 0010:__list_del_entry_valid.cold+0x23/0x4f lib/list_debug.c:45
Code: e8 95 5d d7 fd 0f 0b 4c 89 f6 48 c7 c7 c0 b1 81 88 e8 84 5d d7 fd 0f
0b 4c 89 ea 4c 89 f6 48 c7 c7 00 b1 81 88 e8 70 5d d7 fd <0f> 0b 4c 89 e2
4c 89 f6 48 c7 c7 60 b1 81 88 e8 5c 5d d7 fd 0f 0b
RSP: 0018:ffff8880898b7888 EFLAGS: 00010082
RAX: 000000000000004e RBX: ffffe8ffffd65bd0 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff81684ce6 RDI: ffffed1011316f03
RBP: ffff8880898b78a0 R08: 000000000000004e R09: ffffed1015ce5021
R10: ffffed1015ce5020 R11: ffff8880ae728107 R12: dead000000000200
R13: dead000000000100 R14: ffffea0000f33bc8 R15: ffffea0000f33bc8
FS: 0000000000000000(0000) GS:ffff8880ae700000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000c42cbb8410 CR3: 0000000085594000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
__list_del_entry include/linux/list.h:117 [inline]
list_del include/linux/list.h:125 [inline]
free_block+0xd8/0x250 mm/slab.c:3403
drain_array_locked+0x36/0x90 mm/slab.c:2195
drain_array+0x8c/0xb0 mm/slab.c:4009
cache_reap+0xf4/0x280 mm/slab.c:4050
process_one_work+0xd0c/0x1ce0 kernel/workqueue.c:2153
worker_thread+0x143/0x14a0 kernel/workqueue.c:2296
kthread+0x357/0x430 kernel/kthread.c:246
ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352
Modules linked in:

======================================================
WARNING: possible circular locking dependency detected
4.20.0+ #12 Not tainted
------------------------------------------------------
kworker/1:3/7418 is trying to acquire lock:
000000006a76babf (console_owner){-.-.}, at: log_next
kernel/printk/printk.c:492 [inline]
000000006a76babf (console_owner){-.-.}, at: console_unlock+0x4d3/0x11e0
kernel/printk/printk.c:2395

but task is already holding lock:
00000000adc514b9 (&(&parent->list_lock)->rlock){-.-.}, at: spin_lock_irq
include/linux/spinlock.h:354 [inline]
00000000adc514b9 (&(&parent->list_lock)->rlock){-.-.}, at:
drain_array+0x7a/0xb0 mm/slab.c:4008

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #3 (&(&parent->list_lock)->rlock){-.-.}:
__raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
_raw_spin_lock+0x2f/0x40 kernel/locking/spinlock.c:144
spin_lock include/linux/spinlock.h:329 [inline]
cache_alloc_refill mm/slab.c:2994 [inline]
____cache_alloc mm/slab.c:3114 [inline]
____cache_alloc mm/slab.c:3097 [inline]
__do_cache_alloc mm/slab.c:3336 [inline]
slab_alloc mm/slab.c:3371 [inline]
__do_kmalloc mm/slab.c:3707 [inline]
__kmalloc+0x3fa/0x740 mm/slab.c:3718
kmalloc include/linux/slab.h:550 [inline]
tty_buffer_alloc drivers/tty/tty_buffer.c:175 [inline]
__tty_buffer_request_room+0x2bf/0x7e0 drivers/tty/tty_buffer.c:273
tty_insert_flip_string_fixed_flag+0x93/0x1f0
drivers/tty/tty_buffer.c:318
tty_insert_flip_string include/linux/tty_flip.h:37 [inline]
pty_write+0x133/0x200 drivers/tty/pty.c:122
n_tty_write+0xb9e/0x1220 drivers/tty/n_tty.c:2354
do_tty_write drivers/tty/tty_io.c:959 [inline]
tty_write+0x45b/0x7a0 drivers/tty/tty_io.c:1043
__vfs_write+0x116/0xb40 fs/read_write.c:485
vfs_write+0x20c/0x580 fs/read_write.c:549
ksys_write+0x105/0x260 fs/read_write.c:598
__do_sys_write fs/read_write.c:610 [inline]
__se_sys_write fs/read_write.c:607 [inline]
__x64_sys_write+0x73/0xb0 fs/read_write.c:607
do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x49/0xbe

-> #2 (&(&port->lock)->rlock){-.-.}:
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0x95/0xcd kernel/locking/spinlock.c:152
tty_port_tty_get+0x22/0x80 drivers/tty/tty_port.c:287
tty_port_default_wakeup+0x16/0x40 drivers/tty/tty_port.c:47
tty_port_tty_wakeup+0x5d/0x70 drivers/tty/tty_port.c:387
uart_write_wakeup+0x46/0x70 drivers/tty/serial/serial_core.c:103
serial8250_tx_chars+0x4a4/0xb20
drivers/tty/serial/8250/8250_port.c:1806
serial8250_handle_irq.part.0+0x1be/0x2e0
drivers/tty/serial/8250/8250_port.c:1879
serial8250_handle_irq drivers/tty/serial/8250/8250_port.c:1865
[inline]
serial8250_default_handle_irq+0xc5/0x150
drivers/tty/serial/8250/8250_port.c:1895
serial8250_interrupt+0xfb/0x1a0
drivers/tty/serial/8250/8250_core.c:125
__handle_irq_event_percpu+0x1c6/0xb10 kernel/irq/handle.c:149
handle_irq_event_percpu+0xa0/0x1d0 kernel/irq/handle.c:189
handle_irq_event+0xa7/0x134 kernel/irq/handle.c:206
handle_edge_irq+0x232/0x8a0 kernel/irq/chip.c:791
generic_handle_irq_desc include/linux/irqdesc.h:154 [inline]
handle_irq+0x252/0x3d8 arch/x86/kernel/irq_64.c:78
do_IRQ+0x99/0x1d0 arch/x86/kernel/irq.c:246
ret_from_intr+0x0/0x1e
native_safe_halt+0x2/0x10 arch/x86/include/asm/irqflags.h:57
arch_cpu_idle+0x10/0x20 arch/x86/kernel/process.c:555
default_idle_call+0x36/0x90 kernel/sched/idle.c:93
cpuidle_idle_call kernel/sched/idle.c:153 [inline]
do_idle+0x386/0x5d0 kernel/sched/idle.c:262
cpu_startup_entry+0x1b/0x20 kernel/sched/idle.c:353
start_secondary+0x435/0x620 arch/x86/kernel/smpboot.c:271
secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:243

-> #1 (&port_lock_key){-.-.}:
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0x95/0xcd kernel/locking/spinlock.c:152
serial8250_console_write+0x253/0xab0
drivers/tty/serial/8250/8250_port.c:3245
univ8250_console_write+0x5f/0x70
drivers/tty/serial/8250/8250_core.c:586
call_console_drivers kernel/printk/printk.c:1737 [inline]
console_unlock+0xcff/0x11e0 kernel/printk/printk.c:2408
vprintk_emit+0x370/0x960 kernel/printk/printk.c:1931
vprintk_default+0x28/0x30 kernel/printk/printk.c:1958
vprintk_func+0x7e/0x189 kernel/printk/printk_safe.c:398
printk+0xba/0xed kernel/printk/printk.c:1991
register_console+0x74d/0xb50 kernel/printk/printk.c:2723
univ8250_console_init+0x3e/0x4b
drivers/tty/serial/8250/8250_core.c:681
console_init+0x6b7/0x9fe kernel/printk/printk.c:2809
start_kernel+0x5df/0x8bd init/main.c:667
x86_64_start_reservations+0x29/0x2b arch/x86/kernel/head64.c:470
x86_64_start_kernel+0x77/0x7b arch/x86/kernel/head64.c:451
secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:243

-> #0 (console_owner){-.-.}:
lock_acquire+0x1db/0x570 kernel/locking/lockdep.c:3841
console_lock_spinning_enable kernel/printk/printk.c:1600 [inline]
console_unlock+0x53d/0x11e0 kernel/printk/printk.c:2405
vprintk_emit+0x370/0x960 kernel/printk/printk.c:1931
vprintk_default+0x28/0x30 kernel/printk/printk.c:1958
vprintk_func+0x7e/0x189 kernel/printk/printk_safe.c:398
printk+0xba/0xed kernel/printk/printk.c:1991
__list_del_entry_valid.cold+0x23/0x4f lib/list_debug.c:45
__list_del_entry include/linux/list.h:117 [inline]
list_del include/linux/list.h:125 [inline]
free_block+0xd8/0x250 mm/slab.c:3403
drain_array_locked+0x36/0x90 mm/slab.c:2195
drain_array+0x8c/0xb0 mm/slab.c:4009
cache_reap+0xf4/0x280 mm/slab.c:4050
process_one_work+0xd0c/0x1ce0 kernel/workqueue.c:2153
worker_thread+0x143/0x14a0 kernel/workqueue.c:2296
kthread+0x357/0x430 kernel/kthread.c:246
ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352

other info that might help us debug this:

Chain exists of:
console_owner --> &(&port->lock)->rlock --> &(&parent->list_lock)->rlock

Possible unsafe locking scenario:

CPU0 CPU1
---- ----
lock(&(&parent->list_lock)->rlock);
lock(&(&port->lock)->rlock);
lock(&(&parent->list_lock)->rlock);
lock(console_owner);

*** DEADLOCK ***

5 locks held by kworker/1:3/7418:
#0: 0000000045216fdd ((wq_completion)"events"){+.+.}, at:
__write_once_size include/linux/compiler.h:218 [inline]
#0: 0000000045216fdd ((wq_completion)"events"){+.+.}, at:
arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
#0: 0000000045216fdd ((wq_completion)"events"){+.+.}, at: atomic64_set
include/asm-generic/atomic-instrumented.h:40 [inline]
#0: 0000000045216fdd ((wq_completion)"events"){+.+.}, at: atomic_long_set
include/asm-generic/atomic-long.h:59 [inline]
#0: 0000000045216fdd ((wq_completion)"events"){+.+.}, at: set_work_data
kernel/workqueue.c:617 [inline]
#0: 0000000045216fdd ((wq_completion)"events"){+.+.}, at:
set_work_pool_and_clear_pending kernel/workqueue.c:644 [inline]
#0: 0000000045216fdd ((wq_completion)"events"){+.+.}, at:
process_one_work+0xbc7/0x1ce0 kernel/workqueue.c:2124
#1: 0000000032218038 ((work_completion)(&(reap_work)->work)){+.+.}, at:
process_one_work+0xc1d/0x1ce0 kernel/workqueue.c:2128
#2: 0000000013b9d8f5 (slab_mutex){+.+.}, at: cache_reap+0x38/0x280
mm/slab.c:4034
#3: 00000000adc514b9 (&(&parent->list_lock)->rlock){-.-.}, at:
spin_lock_irq include/linux/spinlock.h:354 [inline]
#3: 00000000adc514b9 (&(&parent->list_lock)->rlock){-.-.}, at:
drain_array+0x7a/0xb0 mm/slab.c:4008
#4: 0000000024e94b7c (console_lock){+.+.}, at: console_trylock_spinning
kernel/printk/printk.c:1662 [inline]
#4: 0000000024e94b7c (console_lock){+.+.}, at: vprintk_emit+0x351/0x960
kernel/printk/printk.c:1930

stack backtrace:
CPU: 1 PID: 7418 Comm: kworker/1:3 Not tainted 4.20.0+ #12
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
Workqueue: events cache_reap
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1db/0x2d0 lib/dump_stack.c:113
print_circular_bug.isra.0.cold+0x1cc/0x28f kernel/locking/lockdep.c:1224
check_prev_add kernel/locking/lockdep.c:1866 [inline]
check_prevs_add kernel/locking/lockdep.c:1979 [inline]
validate_chain kernel/locking/lockdep.c:2350 [inline]
__lock_acquire+0x3014/0x4a30 kernel/locking/lockdep.c:3338
lock_acquire+0x1db/0x570 kernel/locking/lockdep.c:3841
console_lock_spinning_enable kernel/printk/printk.c:1600 [inline]
console_unlock+0x53d/0x11e0 kernel/printk/printk.c:2405
vprintk_emit+0x370/0x960 kernel/printk/printk.c:1931
vprintk_default+0x28/0x30 kernel/printk/printk.c:1958
vprintk_func+0x7e/0x189 kernel/printk/printk_safe.c:398
printk+0xba/0xed kernel/printk/printk.c:1991
__list_del_entry_valid.cold+0x23/0x4f lib/list_debug.c:45
__list_del_entry include/linux/list.h:117 [inline]
list_del include/linux/list.h:125 [inline]
free_block+0xd8/0x250 mm/slab.c:3403
drain_array_locked+0x36/0x90 mm/slab.c:2195
drain_array+0x8c/0xb0 mm/slab.c:4009
cache_reap+0xf4/0x280 mm/slab.c:4050
process_one_work+0xd0c/0x1ce0 kernel/workqueue.c:2153
worker_thread+0x143/0x14a0 kernel/workqueue.c:2296
kthread+0x357/0x430 kernel/kthread.c:246
ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352
---[ end trace 55fa1a801a0e0d1e ]---
RIP: 0010:__list_del_entry_valid.cold+0x23/0x4f lib/list_debug.c:45
Code: e8 95 5d d7 fd 0f 0b 4c 89 f6 48 c7 c7 c0 b1 81 88 e8 84 5d d7 fd 0f
0b 4c 89 ea 4c 89 f6 48 c7 c7 00 b1 81 88 e8 70 5d d7 fd <0f> 0b 4c 89 e2
4c 89 f6 48 c7 c7 60 b1 81 88 e8 5c 5d d7 fd 0f 0b
RSP: 0018:ffff8880898b7888 EFLAGS: 00010082
RAX: 000000000000004e RBX: ffffe8ffffd65bd0 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff81684ce6 RDI: ffffed1011316f03
RBP: ffff8880898b78a0 R08: 000000000000004e R09: ffffed1015ce5021
R10: ffffed1015ce5020 R11: ffff8880ae728107 R12: dead000000000200
R13: dead000000000100 R14: ffffea0000f33bc8 R15: ffffea0000f33bc8
FS: 0000000000000000(0000) GS:ffff8880ae700000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000c42cbb8410 CR3: 0000000085594000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400


---
This bug 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 bug report. See:
https://goo.gl/tpsmEJ#bug-status-tracking for how to communicate with
syzbot.

syzbot

unread,
Oct 25, 2019, 4:39:07 AM10/25/19
to syzkaller-upst...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.
Reply all
Reply to author
Forward
0 new messages