================================================================== 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 ffff8800b05753c0 by task syz-executor0/12350 CPU: 1 PID: 12350 Comm: syz-executor0 Not tainted 4.4.114-ga81d322 #4 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 0000000000000000 e138cbdedabb0ea6 ffff8801c52cf9f0 ffffffff81d0394d ffffea0002c15d40 ffff8800b05753c0 0000000000000000 ffff8800b05753c0 ffff8801d2a00238 ffff8801c52cfa28 ffffffff814fe1d3 ffff8800b05753c0 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 [] do_loop_readv_writev+0x141/0x1e0 fs/read_write.c:680 [] do_readv_writev+0x5dd/0x6e0 fs/read_write.c:810 [] vfs_readv+0x78/0xb0 fs/read_write.c:834 [] SYSC_readv fs/read_write.c:860 [inline] [] SyS_readv+0xd9/0x240 fs/read_write.c:852 [] entry_SYSCALL_64_fastpath+0x1c/0x98 Allocated by task 8089: [] 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 [] entry_SYSCALL_64_fastpath+0x1c/0x98 Freed by task 8089: [] 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+0x1c/0x20 fs/fcntl.c:617 [] do_fcntl_add_lease fs/locks.c:1835 [inline] [] fcntl_setlease+0x168/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 [] entry_SYSCALL_64_fastpath+0x1c/0x98 The buggy address belongs to the object at ffff8800b0575380 which belongs to the cache fasync_cache of size 96 The buggy address is located 64 bytes inside of 96-byte region [ffff8800b0575380, ffff8800b05753e0) The buggy address belongs to the page: kasan: CONFIG_KASAN_INLINE enabled kasan: GPF could be caused by NULL-ptr deref or user memory access[ 75.967666] ------------[ cut here ]------------ WARNING: CPU: 0 PID: 4019 at kernel/sched/core.c:7931 __might_sleep+0x138/0x1a0 kernel/sched/core.c:7926() do not call blocking ops when !TASK_RUNNING; state=1 set at [] do_wait+0x270/0xa20 kernel/exit.c:1503