kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] SMP KASAN
CPU: 0 PID: 12337 Comm: syz-executor2 Not tainted 4.17.0+ #104
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:__delayacct_blkio_end+0x4f/0xc0 kernel/delayacct.c:83
Code: 48 c1 ea 03 80 3c 02 00 0f 85 80 00 00 00 48 8b 9b 48 12 00 00 48 b8 00 00 00 00 00 fc ff df 48 8d 7b 38 48 89 fa 48 c1 ea 03 <0f> b6 04 02 84 c0 74 04 3c 03 7e 51 44 8b 63 38 31 ff 41 83 e4 01
RSP: 0018:ffff8801dae06a10 EFLAGS: 00010002
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffff88018b67c4b8
RDX: 0000000000000007 RSI: ffffffff817cba01 RDI: 0000000000000038
RBP: ffff8801dae06a28 R08: ffffed003b5c46d7 R09: 0000000000000001
R10: ffff8801dae06b38 R11: ffff8801dae236b3 R12: ffff8801cac48400
R13: ffff88018b67c480 R14: ffff88018b67c4bc R15: 0000000000000002
FS: 00007f0ca6864700(0000) GS:ffff8801dae00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffff52f7a38 CR3: 0000000178ecf000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
delayacct_blkio_end include/linux/delayacct.h:128 [inline]
try_to_wake_up+0xacb/0x12b0 kernel/sched/core.c:2057
default_wake_function+0x30/0x50 kernel/sched/core.c:3742
autoremove_wake_function+0x80/0x370 kernel/sched/wait.c:373
wake_page_function+0x15f/0x1c0 mm/filemap.c:1010
__wake_up_common+0x191/0x740 kernel/sched/wait.c:90
__wake_up_locked_key_bookmark+0x16/0x20 kernel/sched/wait.c:165
wake_up_page_bit+0x2ab/0x5b0 mm/filemap.c:1030
wake_up_page mm/filemap.c:1071 [inline]
end_page_writeback+0x250/0x330 mm/filemap.c:1233
ext4_finish_bio+0x59b/0x950 fs/ext4/page-io.c:118
ext4_end_bio+0x18f/0x6d0 fs/ext4/page-io.c:342
bio_endio+0x530/0x9e0 block/bio.c:1836
req_bio_endio block/blk-core.c:281 [inline]
blk_update_request+0x3b2/0xcd0 block/blk-core.c:3091
scsi_end_request+0xde/0x890 drivers/scsi/scsi_lib.c:672
scsi_io_completion+0xcc6/0x1dd0 drivers/scsi/scsi_lib.c:898
scsi_finish_command+0x54a/0x8f0 drivers/scsi/scsi.c:248
scsi_softirq_done+0x3f6/0x4d0 drivers/scsi/scsi_lib.c:1687
__blk_mq_complete_request block/blk-mq.c:583 [inline]
blk_mq_complete_request+0x355/0x630 block/blk-mq.c:620
scsi_mq_done+0xe7/0x450 drivers/scsi/scsi_lib.c:1998
virtscsi_complete_cmd+0x573/0x740 drivers/scsi/virtio_scsi.c:207
virtscsi_vq_done+0xcb/0x180 drivers/scsi/virtio_scsi.c:223
virtscsi_req_done+0xa7/0xd0 drivers/scsi/virtio_scsi.c:238
vring_interrupt+0x128/0x170 drivers/virtio/virtio_ring.c:950
__handle_irq_event_percpu+0x1c8/0xaf0 kernel/irq/handle.c:149
handle_irq_event_percpu+0xa0/0x1d0 kernel/irq/handle.c:189
handle_irq_event+0xa7/0x135 kernel/irq/handle.c:206
handle_edge_irq+0x20f/0x870 kernel/irq/chip.c:791
generic_handle_irq_desc include/linux/irqdesc.h:159 [inline]
handle_irq+0x18c/0x2e7 arch/x86/kernel/irq_64.c:77
do_IRQ+0x78/0x190 arch/x86/kernel/irq.c:245
common_interrupt+0xf/0xf arch/x86/entry/entry_64.S:642
RIP: 0010:arch_local_irq_restore arch/x86/include/asm/paravirt.h:783 [inline]
RIP: 0010:lock_acquire+0x25f/0x540 kernel/locking/lockdep.c:3927
Code: 00 00 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 6a 02 00 00 48 83 3d 08 96 92 07 00 0f 84 d4 01 00 00 48 8b bd 20 ff ff ff 57 9d <0f> 1f 44 00 00 48 b8 00 00 00 00 00 fc ff df 48 01 c3 48 c7 03 00
RSP: 0018:ffff88017d326760 EFLAGS: 00000282 ORIG_RAX: ffffffffffffffda
RAX: dffffc0000000000 RBX: 1ffff1002fa64cf1 RCX: 0000000000000000
RDX: 1ffffffff11e35fd RSI: 0000000000000000 RDI: 0000000000000282
RBP: ffff88017d326850 R08: 0000000000000008 R09: 0000000000000001
R10: ffff8801cac48c60 R11: 3344e8d3981a689d R12: ffff8801cac48400
R13: 0000000000000002 R14: 0000000000000000 R15: 0000000000000000
rcu_lock_acquire include/linux/rcupdate.h:245 [inline]
rcu_read_lock+0x2b/0x70 include/linux/rcupdate.h:631
lock_page_memcg+0x75/0x300 mm/memcontrol.c:1607
page_remove_file_rmap mm/rmap.c:1214 [inline]
page_remove_rmap+0x6b9/0x1260 mm/rmap.c:1299
zap_pte_range mm/memory.c:1333 [inline]
zap_pmd_range mm/memory.c:1437 [inline]
zap_pud_range mm/memory.c:1466 [inline]
zap_p4d_range mm/memory.c:1487 [inline]
unmap_page_range+0xebc/0x2220 mm/memory.c:1508
unmap_single_vma+0x1a0/0x310 mm/memory.c:1553
unmap_vmas+0x120/0x1f0 mm/memory.c:1583
exit_mmap+0x2c2/0x5b0 mm/mmap.c:3105
__mmput kernel/fork.c:970 [inline]
mmput+0x265/0x620 kernel/fork.c:991
exit_mm kernel/exit.c:544 [inline]
do_exit+0xea9/0x2750 kernel/exit.c:852
do_group_exit+0x177/0x440 kernel/exit.c:968
get_signal+0x88e/0x1970 kernel/signal.c:2468
do_signal+0x9c/0x21c0 arch/x86/kernel/signal.c:816
exit_to_usermode_loop+0x2de/0x370 arch/x86/entry/common.c:162
prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline]
syscall_return_slowpath arch/x86/entry/common.c:268 [inline]
do_syscall_64+0x6be/0x820 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x455b29
Code: 1d ba fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 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 0f 83 eb b9 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f0ca6863ce8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: fffffffffffffe00 RBX: 000000000072bf78 RCX: 0000000000455b29
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 000000000072bf78
RBP: 000000000072bf78 R08: 0000000000000000 R09: 000000000072bf50
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffeb53aae7f R14: 00007f0ca68649c0 R15: 0000000000000001
Modules linked in:
Dumping ftrace buffer:
(ftrace buffer empty)
======================================================
WARNING: possible circular locking dependency detected
4.17.0+ #104 Not tainted
------------------------------------------------------
syz-executor2/12337 is trying to acquire lock:
00000000c676825c ((console_sem).lock){-.-.}, at: down_trylock+0x13/0x70 kernel/locking/semaphore.c:136
but task is already holding lock:
0000000034a55d0c (&p->pi_lock){-.-.}, at: try_to_wake_up+0xd2/0x12b0 kernel/sched/core.c:1986
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #1 (&p->pi_lock){-.-.}:
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0x96/0xc0 kernel/locking/spinlock.c:152
try_to_wake_up+0xd2/0x12b0 kernel/sched/core.c:1986
wake_up_process+0x10/0x20 kernel/sched/core.c:2149
__up.isra.1+0x1c0/0x2a0 kernel/locking/semaphore.c:262
up+0x13c/0x1c0 kernel/locking/semaphore.c:187
__up_console_sem+0xbe/0x1b0 kernel/printk/printk.c:242
console_unlock+0x7a2/0x10b0 kernel/printk/printk.c:2411
vprintk_emit+0x6c6/0xdf0 kernel/printk/printk.c:1907
vprintk_default+0x28/0x30 kernel/printk/printk.c:1948
vprintk_func+0x7a/0xe7 kernel/printk/printk_safe.c:382
printk+0xa7/0xcf kernel/printk/printk.c:1981
load_umh+0x51/0xbd net/bpfilter/bpfilter_kern.c:99
do_one_initcall+0x127/0x913 init/main.c:884
do_initcall_level init/main.c:952 [inline]
do_initcalls init/main.c:960 [inline]
do_basic_setup init/main.c:978 [inline]
kernel_init_freeable+0x49b/0x58e init/main.c:1135
kernel_init+0x11/0x1b3 init/main.c:1061
ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:412
-> #0 ((console_sem).lock){-.-.}:
lock_acquire+0x1e4/0x540 kernel/locking/lockdep.c:3924
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0x96/0xc0 kernel/locking/spinlock.c:152
down_trylock+0x13/0x70 kernel/locking/semaphore.c:136
__down_trylock_console_sem+0xae/0x200 kernel/printk/printk.c:225
console_trylock+0x15/0xa0 kernel/printk/printk.c:2230
console_trylock_spinning kernel/printk/printk.c:1643 [inline]
vprintk_emit+0x6ad/0xdf0 kernel/printk/printk.c:1906
vprintk_default+0x28/0x30 kernel/printk/printk.c:1948
vprintk_func+0x7a/0xe7 kernel/printk/printk_safe.c:382
printk+0xa7/0xcf kernel/printk/printk.c:1981
kasan_die_handler.cold.22+0x11/0x30 arch/x86/mm/kasan_init_64.c:251
notifier_call_chain+0x180/0x390 kernel/notifier.c:93
__atomic_notifier_call_chain kernel/notifier.c:183 [inline]
atomic_notifier_call_chain+0x98/0x190 kernel/notifier.c:193
notify_die+0x1be/0x2e0 kernel/notifier.c:549
do_general_protection+0x248/0x2f0 arch/x86/kernel/traps.c:559
general_protection+0x1e/0x30 arch/x86/entry/entry_64.S:1159
__delayacct_blkio_end+0x4f/0xc0 kernel/delayacct.c:83
delayacct_blkio_end include/linux/delayacct.h:128 [inline]
try_to_wake_up+0xacb/0x12b0 kernel/sched/core.c:2057
default_wake_function+0x30/0x50 kernel/sched/core.c:3742
autoremove_wake_function+0x80/0x370 kernel/sched/wait.c:373
wake_page_function+0x15f/0x1c0 mm/filemap.c:1010
__wake_up_common+0x191/0x740 kernel/sched/wait.c:90
__wake_up_locked_key_bookmark+0x16/0x20 kernel/sched/wait.c:165
wake_up_page_bit+0x2ab/0x5b0 mm/filemap.c:1030
wake_up_page mm/filemap.c:1071 [inline]
end_page_writeback+0x250/0x330 mm/filemap.c:1233
ext4_finish_bio+0x59b/0x950 fs/ext4/page-io.c:118
ext4_end_bio+0x18f/0x6d0 fs/ext4/page-io.c:342
bio_endio+0x530/0x9e0 block/bio.c:1836
req_bio_endio block/blk-core.c:281 [inline]
blk_update_request+0x3b2/0xcd0 block/blk-core.c:3091
scsi_end_request+0xde/0x890 drivers/scsi/scsi_lib.c:672
scsi_io_completion+0xcc6/0x1dd0 drivers/scsi/scsi_lib.c:898
scsi_finish_command+0x54a/0x8f0 drivers/scsi/scsi.c:248
scsi_softirq_done+0x3f6/0x4d0 drivers/scsi/scsi_lib.c:1687
__blk_mq_complete_request block/blk-mq.c:583 [inline]
blk_mq_complete_request+0x355/0x630 block/blk-mq.c:620
scsi_mq_done+0xe7/0x450 drivers/scsi/scsi_lib.c:1998
virtscsi_complete_cmd+0x573/0x740 drivers/scsi/virtio_scsi.c:207
virtscsi_vq_done+0xcb/0x180 drivers/scsi/virtio_scsi.c:223
virtscsi_req_done+0xa7/0xd0 drivers/scsi/virtio_scsi.c:238
vring_interrupt+0x128/0x170 drivers/virtio/virtio_ring.c:950
__handle_irq_event_percpu+0x1c8/0xaf0 kernel/irq/handle.c:149
handle_irq_event_percpu+0xa0/0x1d0 kernel/irq/handle.c:189
handle_irq_event+0xa7/0x135 kernel/irq/handle.c:206
handle_edge_irq+0x20f/0x870 kernel/irq/chip.c:791
generic_handle_irq_desc include/linux/irqdesc.h:159 [inline]
handle_irq+0x18c/0x2e7 arch/x86/kernel/irq_64.c:77
do_IRQ+0x78/0x190 arch/x86/kernel/irq.c:245
ret_from_intr+0x0/0x1e
arch_local_irq_restore arch/x86/include/asm/paravirt.h:783 [inline]
lock_acquire+0x25f/0x540 kernel/locking/lockdep.c:3927
rcu_lock_acquire include/linux/rcupdate.h:245 [inline]
rcu_read_lock+0x2b/0x70 include/linux/rcupdate.h:631
lock_page_memcg+0x75/0x300 mm/memcontrol.c:1607
page_remove_file_rmap mm/rmap.c:1214 [inline]
page_remove_rmap+0x6b9/0x1260 mm/rmap.c:1299
zap_pte_range mm/memory.c:1333 [inline]
zap_pmd_range mm/memory.c:1437 [inline]
zap_pud_range mm/memory.c:1466 [inline]
zap_p4d_range mm/memory.c:1487 [inline]
unmap_page_range+0xebc/0x2220 mm/memory.c:1508
unmap_single_vma+0x1a0/0x310 mm/memory.c:1553
unmap_vmas+0x120/0x1f0 mm/memory.c:1583
exit_mmap+0x2c2/0x5b0 mm/mmap.c:3105
__mmput kernel/fork.c:970 [inline]
mmput+0x265/0x620 kernel/fork.c:991
exit_mm kernel/exit.c:544 [inline]
do_exit+0xea9/0x2750 kernel/exit.c:852
do_group_exit+0x177/0x440 kernel/exit.c:968
get_signal+0x88e/0x1970 kernel/signal.c:2468
do_signal+0x9c/0x21c0 arch/x86/kernel/signal.c:816
exit_to_usermode_loop+0x2de/0x370 arch/x86/entry/common.c:162
prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline]
syscall_return_slowpath arch/x86/entry/common.c:268 [inline]
do_syscall_64+0x6be/0x820 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&p->pi_lock);
lock((console_sem).lock);
lock(&p->pi_lock);
lock((console_sem).lock);
*** DEADLOCK ***
6 locks held by syz-executor2/12337:
#0: 00000000ec684c5a (&(ptlock_ptr(page))->rlock#2){+.+.}, at: spin_lock include/linux/spinlock.h:310 [inline]
#0: 00000000ec684c5a (&(ptlock_ptr(page))->rlock#2){+.+.}, at: zap_pte_range mm/memory.c:1294 [inline]
#0: 00000000ec684c5a (&(ptlock_ptr(page))->rlock#2){+.+.}, at: zap_pmd_range mm/memory.c:1437 [inline]
#0: 00000000ec684c5a (&(ptlock_ptr(page))->rlock#2){+.+.}, at: zap_pud_range mm/memory.c:1466 [inline]
#0: 00000000ec684c5a (&(ptlock_ptr(page))->rlock#2){+.+.}, at: zap_p4d_range mm/memory.c:1487 [inline]
#0: 00000000ec684c5a (&(ptlock_ptr(page))->rlock#2){+.+.}, at: unmap_page_range+0x9a3/0x2220 mm/memory.c:1508
#1: 00000000a8744eea (rcu_read_lock){....}, at: rcu_read_lock+0x0/0x70 mm/memcontrol.c:4044
#2: 00000000d66cc40b (&(&virtscsi_vq->vq_lock)->rlock){-.-.}, at: virtscsi_vq_done+0xa5/0x180 drivers/scsi/virtio_scsi.c:219
#3: 000000006c675df5 (&page_wait_table[i]){-.-.}, at: wake_up_page_bit+0x291/0x5b0 mm/filemap.c:1029
#4: 0000000034a55d0c (&p->pi_lock){-.-.}, at: try_to_wake_up+0xd2/0x12b0 kernel/sched/core.c:1986
#5: 00000000a8744eea (rcu_read_lock){....}, at: atomic_notifier_call_chain+0x0/0x190 kernel/notifier.c:329
stack backtrace:
CPU: 0 PID: 12337 Comm: syz-executor2 Not tainted 4.17.0+ #104
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1c9/0x2b4 lib/dump_stack.c:113
print_circular_bug.isra.36.cold.56+0x1bd/0x27d kernel/locking/lockdep.c:1227
check_prev_add kernel/locking/lockdep.c:1867 [inline]
check_prevs_add kernel/locking/lockdep.c:1980 [inline]
validate_chain kernel/locking/lockdep.c:2421 [inline]
__lock_acquire+0x3449/0x5020 kernel/locking/lockdep.c:3435
lock_acquire+0x1e4/0x540 kernel/locking/lockdep.c:3924
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0x96/0xc0 kernel/locking/spinlock.c:152
down_trylock+0x13/0x70 kernel/locking/semaphore.c:136
__down_trylock_console_sem+0xae/0x200 kernel/printk/printk.c:225
console_trylock+0x15/0xa0 kernel/printk/printk.c:2230
console_trylock_spinning kernel/printk/printk.c:1643 [inline]
vprintk_emit+0x6ad/0xdf0 kernel/printk/printk.c:1906
vprintk_default+0x28/0x30 kernel/printk/printk.c:1948
vprintk_func+0x7a/0xe7 kernel/printk/printk_safe.c:382
printk+0xa7/0xcf kernel/printk/printk.c:1981
kasan_die_handler.cold.22+0x11/0x30 arch/x86/mm/kasan_init_64.c:251
notifier_call_chain+0x180/0x390 kernel/notifier.c:93
__atomic_notifier_call_chain kernel/notifier.c:183 [inline]
atomic_notifier_call_chain+0x98/0x190 kernel/notifier.c:193
notify_die+0x1be/0x2e0 kernel/notifier.c:549
do_general_protection+0x248/0x2f0 arch/x86/kernel/traps.c:559
general_protection+0x1e/0x30 arch/x86/entry/entry_64.S:1159
RIP: 0010:__delayacct_blkio_end+0x4f/0xc0 kernel/delayacct.c:83
Code: 48 c1 ea 03 80 3c 02 00 0f 85 80 00 00 00 48 8b 9b 48 12 00 00 48 b8 00 00 00 00 00 fc ff df 48 8d 7b 38 48 89 fa 48 c1 ea 03 <0f> b6 04 02 84 c0 74 04 3c 03 7e 51 44 8b 63 38 31 ff 41 83 e4 01
RSP: 0018:ffff8801dae06a10 EFLAGS: 00010002
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffff88018b67c4b8
RDX: 0000000000000007 RSI: ffffffff817cba01 RDI: 0000000000000038
RBP: ffff8801dae06a28 R08: ffffed003b5c46d7 R09: 0000000000000001
R10: ffff8801dae06b38 R11: ffff8801dae236b3 R12: ffff8801cac48400
R13: ffff88018b67c480 R14: ffff88018b67c4bc R15: 0000000000000002
delayacct_blkio_end include/linux/delayacct.h:128 [inline]
try_to_wake_up+0xacb/0x12b0 kernel/sched/core.c:2057
default_wake_function+0x30/0x50 kernel/sched/core.c:3742
autoremove_wake_function+0x80/0x370 kernel/sched/wait.c:373
wake_page_function+0x15f/0x1c0 mm/filemap.c:1010
__wake_up_common+0x191/0x740 kernel/sched/wait.c:90
__wake_up_locked_key_bookmark+0x16/0x20 kernel/sched/wait.c:165
wake_up_page_bit+0x2ab/0x5b0 mm/filemap.c:1030
Lost 345 message(s)!
---[ end trace 9f91f85608fb74ac ]---
RIP: 0010:__delayacct_blkio_end+0x4f/0xc0 kernel/delayacct.c:83
Code: 48 c1 ea 03 80 3c 02 00 0f 85 80 00 00 00 48 8b 9b 48 12 00 00 48 b8 00 00 00 00 00 fc ff df 48 8d 7b 38 48 89 fa 48 c1 ea 03 <0f> b6 04 02 84 c0 74 04 3c 03 7e 51 44 8b 63 38 31 ff 41 83 e4 01
RSP: 0018:ffff8801dae06a10 EFLAGS: 00010002
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffff88018b67c4b8
RDX: 0000000000000007 RSI: ffffffff817cba01 RDI: 0000000000000038
RBP: ffff8801dae06a28 R08: ffffed003b5c46d7 R09: 0000000000000001
R10: ffff8801dae06b38 R11: ffff8801dae236b3 R12: ffff8801cac48400
R13: ffff88018b67c480 R14: ffff88018b67c4bc R15: 0000000000000002
FS: 00007f0ca6864700(0000) GS:ffff8801dae00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffff52f7a38 CR3: 0000000178ecf000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400