================================================ WARNING: lock held when returning to user space! 4.16.0+ #4 Not tainted ------------------------------------------------ syz-executor0/12073 is leaving the kernel with locks still held! 1 lock held by syz-executor0/12073: netlink: 17 bytes leftover after parsing attributes in process `syz-executor3'. #0: 0000000049362079 (&lo->lo_ctl_mutex/1){+.+.}, at: lo_ioctl+0x8d/0x1ec0 drivers/block/loop.c:1363 FAT-fs (loop4): bogus number of reserved sectors FAT-fs (loop4): Can't find a valid FAT filesystem IPv6: Can't replace route, no match found ================================================================== BUG: KASAN: use-after-free in mutex_spin_on_owner+0x427/0x530 kernel/locking/mutex.c:442 Read of size 4 at addr ffff8801d7d40460 by task syz-executor6/12079 CPU: 0 PID: 12079 Comm: syz-executor6 Not tainted 4.16.0+ #4 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+0x1b9/0x294 lib/dump_stack.c:113 print_address_description+0x6c/0x20b mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.7+0xac/0x2f5 mm/kasan/report.c:412 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:432 mutex_spin_on_owner+0x427/0x530 kernel/locking/mutex.c:442 mutex_optimistic_spin kernel/locking/mutex.c:547 [inline] __mutex_lock_common kernel/locking/mutex.c:852 [inline] __mutex_lock+0x103c/0x17f0 kernel/locking/mutex.c:893 mutex_lock_killable_nested+0x16/0x20 kernel/locking/mutex.c:923 lo_ioctl+0x8d/0x1ec0 drivers/block/loop.c:1363 __blkdev_driver_ioctl block/ioctl.c:303 [inline] blkdev_ioctl+0x9b6/0x2020 block/ioctl.c:601 block_ioctl+0xee/0x130 fs/block_dev.c:1875 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:500 [inline] do_vfs_ioctl+0x1cf/0x1650 fs/ioctl.c:684 ksys_ioctl+0xa9/0xd0 fs/ioctl.c:701 SYSC_ioctl fs/ioctl.c:708 [inline] SyS_ioctl+0x24/0x30 fs/ioctl.c:706 do_syscall_64+0x29e/0x9d0 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x4550c7 RSP: 002b:00007fd4ecd0bbb8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000020000068 RCX: 00000000004550c7 RDX: 0000000000000013 RSI: 0000000000004c00 RDI: 0000000000000014 RBP: 0000000000000001 R08: 0000000000000000 R09: 000000000000000a R10: 0000000000000075 R11: 0000000000000246 R12: 0000000000000013 R13: 0000000000000674 R14: 00000000006fcb80 R15: 0000000000000000 Allocated by task 12068: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xc4/0xe0 mm/kasan/kasan.c:552 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:489 slab_post_alloc_hook mm/slab.h:443 [inline] slab_alloc_node mm/slab.c:3323 [inline] kmem_cache_alloc_node+0x131/0x780 mm/slab.c:3630 alloc_task_struct_node kernel/fork.c:157 [inline] dup_task_struct kernel/fork.c:770 [inline] copy_process.part.39+0x16bf/0x6ee0 kernel/fork.c:1631 copy_process kernel/fork.c:1606 [inline] _do_fork+0x291/0x12a0 kernel/fork.c:2087 SYSC_clone kernel/fork.c:2194 [inline] SyS_clone+0x37/0x50 kernel/fork.c:2188 do_syscall_64+0x29e/0x9d0 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 Freed by task 4518: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] __kasan_slab_free+0x11a/0x170 mm/kasan/kasan.c:520 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:527 __cache_free mm/slab.c:3486 [inline] kmem_cache_free+0x86/0x2d0 mm/slab.c:3744 free_task_struct kernel/fork.c:162 [inline] free_task+0x166/0x1d0 kernel/fork.c:391 __put_task_struct+0x2d2/0x600 kernel/fork.c:657 put_task_struct include/linux/sched/task.h:96 [inline] delayed_put_task_struct+0x367/0x470 kernel/exit.c:180 __rcu_reclaim kernel/rcu/rcu.h:178 [inline] rcu_do_batch kernel/rcu/tree.c:2675 [inline] invoke_rcu_callbacks kernel/rcu/tree.c:2930 [inline] __rcu_process_callbacks kernel/rcu/tree.c:2897 [inline] rcu_process_callbacks+0x941/0x15f0 kernel/rcu/tree.c:2914 __do_softirq+0x2e0/0xaf5 kernel/softirq.c:285 The buggy address belongs to the object at ffff8801d7d40400 which belongs to the cache task_struct(113:syz0) of size 6016 The buggy address is located 96 bytes inside of 6016-byte region [ffff8801d7d40400, ffff8801d7d41b80) The buggy address belongs to the page: page:ffffea00075f5000 count:1 mapcount:0 mapping:ffff8801d7d40400 index:0x0 compound_mapcount: 0 flags: 0x2fffc0000008100(slab|head) raw: 02fffc0000008100 ffff8801d7d40400 0000000000000000 0000000100000001 raw: ffffea0006b60c20 ffffea0006b4c5a0 ffff8801ae00dcc0 ffff8801d74f8a80 page dumped because: kasan: bad access detected page->mem_cgroup:ffff8801d74f8a80 Memory state around the buggy address: ffff8801d7d40300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8801d7d40380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8801d7d40400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801d7d40480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801d7d40500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================