audit: type=1400 audit(1515086285.119:7): avc: denied { map } for pid=3470 comm="syzkaller087241" path="/root/syzkaller087241333" dev="sda1" ino=16481 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file permissive=1 ================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x3c41/0x3cf0 kernel/locking/lockdep.c:3305 Read of size 8 at addr ffff8801c7b99b38 by task syzkaller087241/3470 CPU: 1 PID: 3470 Comm: syzkaller087241 Not tainted 4.15.0-rc6-next-20180103+ #87 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x137/0x198 lib/dump_stack.c:53 print_address_description+0x73/0x250 mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:355 [inline] kasan_report+0x23b/0x360 mm/kasan/report.c:413 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:434 __lock_acquire+0x3c41/0x3cf0 kernel/locking/lockdep.c:3305 lock_acquire+0x16b/0x420 kernel/locking/lockdep.c:3914 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x96/0xc0 kernel/locking/spinlock.c:152 remove_wait_queue+0x24/0x1b0 kernel/sched/wait.c:50 ep_remove_wait_queue fs/eventpoll.c:595 [inline] ep_unregister_pollwait.isra.7+0x9d/0x360 fs/eventpoll.c:613 ep_free+0xae/0x230 fs/eventpoll.c:830 ep_eventpoll_release+0x44/0x60 fs/eventpoll.c:862 __fput+0x291/0x6e0 fs/file_table.c:209 ____fput+0x15/0x20 fs/file_table.c:243 task_work_run+0x122/0x1a0 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0x7f4/0x2da0 kernel/exit.c:869 do_group_exit+0x108/0x320 kernel/exit.c:972 SYSC_exit_group kernel/exit.c:983 [inline] SyS_exit_group+0x1d/0x20 kernel/exit.c:981 entry_SYSCALL_64_fastpath+0x23/0x9a RIP: 0033:0x442a48 RSP: 002b:00007ffeb1be53d8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 6e69622f7665642f RCX: 0000000000442a48 RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000 RBP: 00000000006ce018 R08: 00000000000000e7 R09: ffffffffffffffd0 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000401a90 R13: 0000000000401b20 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 3470: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:551 kmem_cache_alloc_trace+0x136/0x750 mm/slab.c:3607 kmalloc include/linux/slab.h:515 [inline] kzalloc include/linux/slab.h:704 [inline] binder_get_thread+0x15d/0x700 drivers/android/binder.c:4282 binder_poll+0x4a/0x210 drivers/android/binder.c:4384 ep_item_poll.isra.10+0xf2/0x320 fs/eventpoll.c:885 ep_insert fs/eventpoll.c:1457 [inline] SYSC_epoll_ctl fs/eventpoll.c:2104 [inline] SyS_epoll_ctl+0x11c4/0x27b0 fs/eventpoll.c:1990 entry_SYSCALL_64_fastpath+0x23/0x9a Freed by task 3470: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0x71/0xc0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3485 [inline] kfree+0xd6/0x260 mm/slab.c:3800 binder_free_thread drivers/android/binder.c:4309 [inline] binder_thread_dec_tmpref+0x17d/0x1e0 drivers/android/binder.c:1882 binder_thread_release+0x27d/0x540 drivers/android/binder.c:4373 binder_ioctl+0xa1b/0x10ee drivers/android/binder.c:4590 vfs_ioctl fs/ioctl.c:46 [inline] do_vfs_ioctl+0x190/0xfe0 fs/ioctl.c:686 SYSC_ioctl fs/ioctl.c:701 [inline] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:692 entry_SYSCALL_64_fastpath+0x23/0x9a The buggy address belongs to the object at ffff8801c7b99a80 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 184 bytes inside of 512-byte region [ffff8801c7b99a80, ffff8801c7b99c80) The buggy address belongs to the page: page:ffffea00071ee640 count:1 mapcount:0 mapping:ffff8801c7b99080 index:0x0 flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffff8801c7b99080 0000000000000000 0000000100000006 raw: ffffea0007373e60 ffff8801db001748 ffff8801db000940 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801c7b99a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8801c7b99a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8801c7b99b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801c7b99b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801c7b99c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================