audit: type=1400 audit(1517745179.393:14): avc: denied { write } for pid=5635 comm="syz-executor1" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=netlink_fib_lookup_socket permissive=1 ================================================================== BUG: KASAN: double-free or invalid-free in relay_open+0x603/0x860 kernel/relay.c:614 CPU: 1 PID: 5641 Comm: syz-executor6 Not tainted 4.9.80-gb30d2b5 #28 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 ffff8801c556f8b8 ffffffff81d94b69 ffffea0006f12c80 ffff8801bc4b2780 ffff8801da001280 ffffffff8137d8a3 0000000000000282 ffff8801c556f8f0 ffffffff8153e093 ffff8801bc4b2780 ffffffff8137d8a3 ffff8801da001280 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x128 lib/dump_stack.c:51 [] print_address_description+0x73/0x280 mm/kasan/report.c:252 [] kasan_report_double_free+0x64/0xa0 mm/kasan/report.c:333 [] kasan_slab_free+0xa4/0xc0 mm/kasan/kasan.c:572 [] slab_free_hook mm/slub.c:1355 [inline] [] slab_free_freelist_hook mm/slub.c:1377 [inline] [] slab_free mm/slub.c:2958 [inline] [] kfree+0x103/0x300 mm/slub.c:3878 [] relay_open+0x603/0x860 kernel/relay.c:614 [] do_blk_trace_setup+0x3e9/0x950 kernel/trace/blktrace.c:501 [] blk_trace_setup+0xe0/0x1a0 kernel/trace/blktrace.c:545 [] blk_trace_ioctl+0x1de/0x300 kernel/trace/blktrace.c:654 [] blkdev_ioctl+0xb00/0x1a60 block/ioctl.c:576 [] block_ioctl+0xde/0x120 fs/block_dev.c:1688 [] vfs_ioctl fs/ioctl.c:43 [inline] [] do_vfs_ioctl+0x1aa/0x1140 fs/ioctl.c:679 [] SYSC_ioctl fs/ioctl.c:694 [inline] [] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:685 [] entry_SYSCALL_64_fastpath+0x29/0xe8 Allocated by task 5641: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack+0x43/0xd0 mm/kasan/kasan.c:505 set_track mm/kasan/kasan.c:517 [inline] kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:609 kmem_cache_alloc_trace+0xfb/0x2a0 mm/slub.c:2742 kmalloc include/linux/slab.h:490 [inline] kzalloc include/linux/slab.h:636 [inline] relay_open+0x91/0x860 kernel/relay.c:576 do_blk_trace_setup+0x3e9/0x950 kernel/trace/blktrace.c:501 blk_trace_setup+0xe0/0x1a0 kernel/trace/blktrace.c:545 blk_trace_ioctl+0x1de/0x300 kernel/trace/blktrace.c:654 blkdev_ioctl+0xb00/0x1a60 block/ioctl.c:576 block_ioctl+0xde/0x120 fs/block_dev.c:1688 vfs_ioctl fs/ioctl.c:43 [inline] do_vfs_ioctl+0x1aa/0x1140 fs/ioctl.c:679 SYSC_ioctl fs/ioctl.c:694 [inline] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:685 entry_SYSCALL_64_fastpath+0x29/0xe8 Freed by task 5641: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack+0x43/0xd0 mm/kasan/kasan.c:505 set_track mm/kasan/kasan.c:517 [inline] kasan_slab_free+0x72/0xc0 mm/kasan/kasan.c:582 slab_free_hook mm/slub.c:1355 [inline] slab_free_freelist_hook mm/slub.c:1377 [inline] slab_free mm/slub.c:2958 [inline] kfree+0x103/0x300 mm/slub.c:3878 relay_destroy_channel+0x16/0x20 kernel/relay.c:199 kref_sub include/linux/kref.h:73 [inline] kref_put include/linux/kref.h:98 [inline] relay_open+0x5ea/0x860 kernel/relay.c:612 do_blk_trace_setup+0x3e9/0x950 kernel/trace/blktrace.c:501 blk_trace_setup+0xe0/0x1a0 kernel/trace/blktrace.c:545 blk_trace_ioctl+0x1de/0x300 kernel/trace/blktrace.c:654 blkdev_ioctl+0xb00/0x1a60 block/ioctl.c:576 block_ioctl+0xde/0x120 fs/block_dev.c:1688 vfs_ioctl fs/ioctl.c:43 [inline] do_vfs_ioctl+0x1aa/0x1140 fs/ioctl.c:679 SYSC_ioctl fs/ioctl.c:694 [inline] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:685 entry_SYSCALL_64_fastpath+0x29/0xe8 The buggy address belongs to the object at ffff8801bc4b2780 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 0 bytes inside of 512-byte region [ffff8801bc4b2780, ffff8801bc4b2980) The buggy address belongs to the page: page:ffffea0006f12c80 count:1 mapcount:0 mapping: (null) index:0x0 compound_mapcount: 0 flags: 0x8000000000004080(slab|head) page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801bc4b2680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801bc4b2700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8801bc4b2780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801bc4b2800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801bc4b2880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================