================================================================== 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 ffff8801cdf8b240 by task syz-executor3/16059 CPU: 1 PID: 16059 Comm: syz-executor3 Not tainted 4.4.120-gd63fdf6 #29 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 0000000000000000 2c3616b7ce43c702 ffff8800b6d97a40 ffffffff81d0408d ffffea000737e2c0 ffff8801cdf8b240 0000000000000000 ffff8801cdf8b240 ffff8801cdc90238 ffff8800b6d97a78 ffffffff814fe143 ffff8801cdf8b240 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 [] do_syscall_32_irqs_on arch/x86/entry/common.c:392 [inline] [] do_fast_syscall_32+0x321/0x8a0 arch/x86/entry/common.c:459 [] sysenter_flags_fixed+0xd/0x17 Allocated by task 12232: [] 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+0x1a/0x20 fs/fcntl.c:607 [] do_fcntl_add_lease fs/locks.c:1824 [inline] [] fcntl_setlease+0xcb/0x220 fs/locks.c:1853 [] do_fcntl fs/fcntl.c:328 [inline] [] SYSC_fcntl fs/fcntl.c:375 [inline] [] SyS_fcntl+0x6e7/0xc40 fs/fcntl.c:360 [] C_SYSC_fcntl64 fs/compat.c:483 [inline] [] compat_SyS_fcntl64+0xce/0x4f0 fs/compat.c:417 [] do_syscall_32_irqs_on arch/x86/entry/common.c:392 [inline] [] do_fast_syscall_32+0x321/0x8a0 arch/x86/entry/common.c:459 [] sysenter_flags_fixed+0xd/0x17 Freed by task 14: [] 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:566 [] __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 ffff8801cdf8b200 which belongs to the cache fasync_cache of size 96 The buggy address is located 64 bytes inside of 96-byte region [ffff8801cdf8b200, ffff8801cdf8b260) The buggy address belongs to the page: kasan: CONFIG_KASAN_INLINE enabled kasan: GPF could be caused by NULL-ptr deref or user memory accessgeneral protection fault: 0000 [#1] PREEMPT SMP KASAN Dumping ftrace buffer: (ftrace buffer empty) Modules linked in: CPU: 0 PID: 185 Comm: kworker/0:1 Not tainted 4.4.120-gd63fdf6 #29 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events vmstat_shepherd task: ffff8801d90b8000 task.stack: ffff8801d90c8000 RIP: 0010:[] [] lookup_object lib/debugobjects.c:120 [inline] RIP: 0010:[] [] debug_object_activate+0x1de/0x500 lib/debugobjects.c:405 RSP: 0018:ffff8801d90cfa20 EFLAGS: 00010003 RAX: 1ffff10016db2fe9 RBX: 00000000f6ff509c RCX: ffffffff8428fc00 RDX: 000000001edfea16 RSI: 0000000000000008 RDI: 00000000f6ff50b4 RBP: ffff8801d90cfaf0 R08: ffffffff85797088 R09: 0000000000000092 R10: 0000000000000001 R11: 1ffff1003b219f0a R12: 1ffff1003b219f48 R13: 0000000000006d32 R14: ffff8801db31b720 R15: dffffc0000000000 FS: 0000000000000000(0000) GS:ffff8801db200000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000081163b4 CR3: 00000001c32a4000 CR4: 0000000000160670 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Stack: ffffffff842bdb60 ffffffff8428fc00 0000000000000092 ffffffff85797088 0000000041b58ab3 ffffffff83fce929 ffffffff81d65960 0000000000000046 0000000000000000 0000000000000000 0000000000000005 ffff8801db31b720 Call Trace: [] debug_work_activate kernel/workqueue.c:499 [inline] [] __queue_work+0x48/0xea0 kernel/workqueue.c:1354 [] __queue_delayed_work+0x237/0x390 kernel/workqueue.c:1495 [] queue_delayed_work_on+0x59/0xb0 kernel/workqueue.c:1533 [] vmstat_shepherd+0x1c1/0x220 mm/vmstat.c:1488 [] process_one_work+0x7d7/0x16e0 kernel/workqueue.c:2064 [] worker_thread+0xd9/0xfc0 kernel/workqueue.c:2196 [] kthread+0x268/0x300 kernel/kthread.c:211 [] ret_from_fork+0x55/0x80 arch/x86/entry/entry_64.S:506 Code: d8 48 c1 e8 03 42 80 3c 38 00 0f 85 80 02 00 00 48 8b 1b 48 85 db 0f 84 84 00 00 00 48 8d 7b 18 41 83 c5 01 48 89 fa 48 c1 ea 03 <42> 80 3c 3a 00 0f 85 32 02 00 00 4c 3b 73 18 75 c2 4c 8d 6b 10 RIP [] lookup_object lib/debugobjects.c:120 [inline] RIP [] debug_object_activate+0x1de/0x500 lib/debugobjects.c:405 RSP ---[ end trace 2b2ba536a6079b77 ]---