================================================================== BUG: KASAN: use-after-free in list_empty include/linux/list.h:189 [inline] BUG: KASAN: use-after-free in sg_remove_request+0xf9/0x110 drivers/scsi/sg.c:2120 Read of size 8 at addr ffff8801d20bfd40 by task syz-executor4/12365 CPU: 1 PID: 12365 Comm: syz-executor4 Not tainted 4.4.113-g202e079 #1 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 0000000000000000 8cdf750419e4d0ca ffff8801ce35fab0 ffffffff81d0278d ffffea0007482fc0 ffff8801d20bfd40 0000000000000000 ffff8801d20bfd40 ffff8800bae82338 ffff8801ce35fae8 ffffffff814fd053 ffff8801d20bfd40 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x124 lib/dump_stack.c:51 [] print_address_description+0x73/0x260 mm/kasan/report.c:252 [] kasan_report_error mm/kasan/report.c:351 [inline] [] kasan_report+0x285/0x370 mm/kasan/report.c:408 [] __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:429 [] list_empty include/linux/list.h:189 [inline] [] sg_remove_request+0xf9/0x110 drivers/scsi/sg.c:2120 [] sg_finish_rem_req+0x295/0x340 drivers/scsi/sg.c:1837 [] sg_read+0xa1b/0x1490 drivers/scsi/sg.c:537 [] __vfs_read+0x103/0x440 fs/read_write.c:432 [] vfs_read+0x123/0x3a0 fs/read_write.c:454 [] SYSC_read fs/read_write.c:569 [inline] [] SyS_read+0xd9/0x1b0 fs/read_write.c:562 [] entry_SYSCALL_64_fastpath+0x1c/0x98 Allocated by task 9204: [] save_stack_trace+0x26/0x50 arch/x86/kernel/stacktrace.c:63 [] save_stack+0x43/0xd0 mm/kasan/kasan.c:512 [] set_track mm/kasan/kasan.c:524 [inline] [] kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:616 [] kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:554 [] slab_post_alloc_hook mm/slub.c:1349 [inline] [] slab_alloc_node mm/slub.c:2615 [inline] [] slab_alloc mm/slub.c:2623 [inline] [] kmem_cache_alloc+0xba/0x290 mm/slub.c:2628 [] fasync_alloc fs/fcntl.c:603 [inline] [] fasync_add_entry fs/fcntl.c:661 [inline] [] fasync_helper+0x37/0xb0 fs/fcntl.c:690 [] pipe_fasync+0xf8/0x1c0 fs/pipe.c:581 [] setfl fs/fcntl.c:69 [inline] [] do_fcntl fs/fcntl.c:266 [inline] [] SYSC_fcntl fs/fcntl.c:371 [inline] [] SyS_fcntl+0x64f/0xc40 fs/fcntl.c:356 [] entry_SYSCALL_64_fastpath+0x1c/0x98 Freed by task 9232: [] save_stack_trace+0x26/0x50 arch/x86/kernel/stacktrace.c:63 [] save_stack+0x43/0xd0 mm/kasan/kasan.c:512 [] set_track mm/kasan/kasan.c:524 [inline] [] kasan_slab_free+0x72/0xc0 mm/kasan/kasan.c:589 [] slab_free_hook mm/slub.c:1383 [inline] [] slab_free_freelist_hook mm/slub.c:1405 [inline] [] slab_free mm/slub.c:2859 [inline] [] kmem_cache_free+0xc7/0x320 mm/slub.c:2881 [] fasync_free_rcu+0x1d/0x20 fs/fcntl.c:562 [] __rcu_reclaim kernel/rcu/rcu.h:118 [inline] [] rcu_do_batch kernel/rcu/tree.c:2705 [inline] [] invoke_rcu_callbacks kernel/rcu/tree.c:2973 [inline] [] __rcu_process_callbacks kernel/rcu/tree.c:2940 [inline] [] rcu_process_callbacks+0x7f4/0x14a0 kernel/rcu/tree.c:2957 [] __do_softirq+0x227/0xa38 kernel/softirq.c:273 The buggy address belongs to the object at ffff8801d20bfd00 which belongs to the cache fasync_cache of size 96 The buggy address is located 64 bytes inside of 96-byte region [ffff8801d20bfd00, ffff8801d20bfd60) The buggy address belongs to the page: BUG: unable to handle kernel paging request at fffffffdf62ab780 IP: [] cpuacct_charge+0x155/0x390 kernel/sched/cpuacct.c:247 PGD 420f067 PUD 0 Oops: 0000 [#1] PREEMPT SMP KASAN Dumping ftrace buffer: (ftrace buffer empty) Modules linked in: CPU: 0 PID: 12353 Comm: syz-executor4 Not tainted 4.4.113-g202e079 #1 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 task: ffff8801d78997c0 task.stack: ffff8800bab88000 RIP: 0010:[] [] cpuacct_charge+0x155/0x390 kernel/sched/cpuacct.c:247 RSP: 0000:ffff8801db207a20 EFLAGS: 00010046 RAX: 1ffffffff0854fff RBX: 0000000000018528 RCX: ffffffff847eb500 RDX: fffffbffbec556f0 RSI: fffffffdf62ab780 RDI: ffffffff842a7ff8 RBP: ffff8801db207a68 R08: 0000000000000001 R09: 0000000000000001 R10: 0000000000000000 R11: 1ffff1003b640f10 R12: ffffffff842a7f20 R13: dffffc0000000000 R14: 00000000649d2562 R15: ffffffffce358050 FS: 0000000001130940(0063) GS:ffff8801db200000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: fffffffdf62ab780 CR3: 00000000b0fde000 CR4: 0000000000160670 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Stack: ffffffff8122a430 ffff8801db207a50 0000000000000046 0000000000000003 ffff8800ba531820 ffffffff83844340 00000000649d2562 ffff8800ba531870 ffff8800ba5317c0 ffff8801db207ab8 ffffffff811dbea7 ffff8801db31f4c0 Call Trace: [] update_curr+0x2c7/0x6c0 kernel/sched/fair.c:882 [] enqueue_entity kernel/sched/fair.c:3511 [inline] [] enqueue_task_fair+0x313/0x2940 kernel/sched/fair.c:4694 [] enqueue_task kernel/sched/core.c:856 [inline] [] activate_task+0x148/0x270 kernel/sched/core.c:872 [] ttwu_activate kernel/sched/core.c:1734 [inline] [] ttwu_do_activate.constprop.131+0xbf/0x1e0 kernel/sched/core.c:1787 [] ttwu_queue kernel/sched/core.c:1932 [inline] [] try_to_wake_up+0x68d/0xf60 kernel/sched/core.c:2066 [] wake_up_process+0x15/0x20 kernel/sched/core.c:2140 [] wake_up_worker kernel/workqueue.c:846 [inline] [] insert_work+0x171/0x210 kernel/workqueue.c:1318 [] __queue_work+0x3dc/0xea0 kernel/workqueue.c:1433 [] delayed_work_timer_fn+0x68/0x90 kernel/workqueue.c:1472 [] call_timer_fn+0x18b/0x860 kernel/time/timer.c:1178 [] __run_timers kernel/time/timer.c:1250 [inline] [] run_timer_softirq+0x4a5/0xbb0 kernel/time/timer.c:1437 [] __do_softirq+0x227/0xa38 kernel/softirq.c:273 [] invoke_softirq kernel/softirq.c:350 [inline] [] irq_exit+0x119/0x140 kernel/softirq.c:391 [] exiting_irq arch/x86/include/asm/apic.h:653 [inline] [] smp_apic_timer_interrupt+0x7b/0xa0 arch/x86/kernel/apic/apic.c:926 [] apic_timer_interrupt+0xa0/0xb0 arch/x86/entry/entry_64.S:737 [] smp_call_function_many+0x47d/0x720 kernel/smp.c:435 [] native_flush_tlb_others+0xfe/0x710 arch/x86/mm/tlb.c:292 [] flush_tlb_others arch/x86/include/asm/paravirt.h:338 [inline] [] flush_tlb_mm_range+0x103/0x560 arch/x86/mm/tlb.c:358 [] flush_tlb_page arch/x86/include/asm/tlbflush.h:287 [inline] [] ptep_clear_flush+0xd5/0x110 mm/pgtable-generic.c:80 [] wp_page_copy.isra.72+0x5e6/0xad0 mm/memory.c:2156 [] do_wp_page+0x1bd/0x10d0 mm/memory.c:2395 [] handle_pte_fault mm/memory.c:3314 [inline] [] __handle_mm_fault mm/memory.c:3426 [inline] [] handle_mm_fault+0x19d4/0x3190 mm/memory.c:3455 [] __do_page_fault+0x35b/0xa00 arch/x86/mm/fault.c:1245 [] do_page_fault+0x27/0x30 arch/x86/mm/fault.c:1308 [] page_fault+0x28/0x30 arch/x86/entry/entry_64.S:1033 Code: 49 8d bc 24 d8 00 00 00 48 89 f8 48 c1 e8 03 42 80 3c 28 00 0f 85 9e 01 00 00 49 8b 9c 24 d8 00 00 00 80 3a 00 0f 85 0a 02 00 00 <4a> 03 1c f9 48 89 d8 48 c1 e8 03 42 80 3c 28 00 0f 85 cf 01 00 RIP [] cpuacct_charge+0x155/0x390 kernel/sched/cpuacct.c:247 RSP CR2: fffffffdf62ab780 ---[ end trace 014d61a82ef81777 ]---