bisecting fixing commit since c6db52a88798e5a0dfef80041ad4d33cc8cf04eb building syzkaller on 2420d1bcbcd9f5d5893c1aab8096cce81721dac2 testing commit c6db52a88798e5a0dfef80041ad4d33cc8cf04eb with gcc (GCC) 8.1.0 kernel signature: 5a7ec372b685f270c04075d661ff0357c82a5efa005be682b180db5a950e7abf run #0: crashed: KASAN: use-after-free Read in bcm_can_tx run #1: crashed: KASAN: use-after-free Read in bcm_can_tx run #2: crashed: KASAN: use-after-free Read in tasklet_action run #3: crashed: KASAN: use-after-free Read in bcm_can_tx run #4: crashed: WARNING: ODEBUG bug in enqueue_hrtimer run #5: crashed: KASAN: use-after-free Read in tasklet_action run #6: crashed: KASAN: use-after-free Read in tasklet_action run #7: crashed: KASAN: use-after-free Read in tasklet_action run #8: OK run #9: OK testing current HEAD 87335852c5d9ec629f80bb2257b9a9945962b719 testing commit 87335852c5d9ec629f80bb2257b9a9945962b719 with gcc (GCC) 8.1.0 kernel signature: 8855ffb1ef28b10947a6b16878276cbeb0e910041eddfc537173258543965e02 run #0: boot failed: failed to create instance: googleapi: Error 503: Internal error. Please try again or contact Google Support. (Code: '5B57472F28CB1.A6A6D8D.BB09AA5C'), backendError run #1: crashed: KASAN: use-after-free Read in bcm_can_tx run #2: crashed: KASAN: use-after-free Read in tasklet_action run #3: crashed: KASAN: use-after-free Read in tasklet_action run #4: crashed: KASAN: use-after-free Read in tasklet_action run #5: crashed: KASAN: use-after-free Read in bcm_can_tx run #6: crashed: WARNING: ODEBUG bug in enqueue_hrtimer run #7: crashed: WARNING: ODEBUG bug in enqueue_hrtimer run #8: crashed: KASAN: use-after-free Read in tasklet_action run #9: crashed: KASAN: use-after-free Read in bcm_can_tx revisions tested: 2, total time: 44m30.388388426s (build: 23m15.104681693s, test: 20m35.039015318s) the crash still happens on HEAD commit msg: Linux 4.14.209 crash: KASAN: use-after-free Read in bcm_can_tx IPv6: ADDRCONF(NETDEV_UP): batadv_slave_1: link is not ready batman_adv: batadv0: Interface activated: batadv_slave_1 IPv6: ADDRCONF(NETDEV_CHANGE): batadv_slave_1: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): veth1_to_batadv: link becomes ready ================================================================== BUG: KASAN: use-after-free in bcm_can_tx+0x4b7/0x640 net/can/bcm.c:312 Read of size 4 at addr ffff8881dde02ed0 by task syz-executor435/12185 CPU: 0 PID: 12185 Comm: syz-executor435 Not tainted 4.14.209-syzkaller #0 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+0x14b/0x1f1 lib/dump_stack.c:58 print_address_description.cold.6+0x9/0x1ca mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report.cold.7+0x11a/0x2d4 mm/kasan/report.c:409 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:429 bcm_can_tx+0x4b7/0x640 net/can/bcm.c:312 bcm_tx_timeout_tsklet+0xed/0x260 net/can/bcm.c:422 tasklet_action+0x19e/0x360 kernel/softirq.c:513 __do_softirq+0x246/0x9b5 kernel/softirq.c:288 invoke_softirq kernel/softirq.c:368 [inline] irq_exit+0x15f/0x1a0 kernel/softirq.c:409 exiting_irq arch/x86/include/asm/apic.h:648 [inline] smp_apic_timer_interrupt+0x145/0x5d0 arch/x86/kernel/apic/apic.c:1102 apic_timer_interrupt+0x9a/0xa0 arch/x86/entry/entry_64.S:793 RIP: 0010:arch_local_irq_restore arch/x86/include/asm/paravirt.h:779 [inline] RIP: 0010:lock_acquire+0x1f3/0x3e0 kernel/locking/lockdep.c:4001 RSP: 0018:ffff8881f3a57878 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff10 RAX: dffffc0000000000 RBX: ffff8881da952540 RCX: 1ffff1103b52a5bd RDX: 1ffffffff0fe2bc1 RSI: ffff8881da952dc8 RDI: 0000000000000286 RBP: ffff8881f3a578c0 R08: 00000000000018ed R09: ffffffff89537f68 R10: 0000000000000000 R11: ffff8881da952540 R12: 0000000000000000 R13: 0000000000000001 R14: 0000000000000001 R15: 0000000000000000 __might_fault+0x124/0x1b0 mm/memory.c:4677 _copy_from_user+0x25/0xd0 lib/usercopy.c:10 copy_from_user include/linux/uaccess.h:147 [inline] rw_copy_check_uvector+0x66/0x330 fs/read_write.c:782 import_iovec+0x96/0x420 lib/iov_iter.c:1411 copy_msghdr_from_user+0x201/0x3f0 net/socket.c:1981 ___sys_sendmsg+0xd0/0x920 net/socket.c:2007 __sys_sendmsg+0xc1/0x140 net/socket.c:2096 SYSC_sendmsg net/socket.c:2107 [inline] SyS_sendmsg+0xd/0x20 net/socket.c:2103 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x44a409 RSP: 002b:00007fda19fbdce8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00000000006e0c28 RCX: 000000000044a409 RDX: 0000000000000000 RSI: 00000000200000c0 RDI: 0000000000000003 RBP: 00000000006e0c20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000006e0c2c R13: 00007ffda5e236bf R14: 00007fda19fbe9c0 R15: 20c49ba5e353f7cf Allocated by task 12184: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc.part.1+0x62/0xf0 mm/kasan/kasan.c:551 kasan_kmalloc+0xaf/0xc0 mm/kasan/kasan.c:536 kmem_cache_alloc_trace+0x152/0x3f0 mm/slab.c:3618 kmalloc include/linux/slab.h:488 [inline] kzalloc include/linux/slab.h:661 [inline] bcm_tx_setup net/can/bcm.c:952 [inline] bcm_sendmsg+0x1994/0x4520 net/can/bcm.c:1388 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xac/0xf0 net/socket.c:656 ___sys_sendmsg+0x625/0x920 net/socket.c:2062 __sys_sendmsg+0xc1/0x140 net/socket.c:2096 SYSC_sendmsg net/socket.c:2107 [inline] SyS_sendmsg+0xd/0x20 net/socket.c:2103 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb Freed by task 12178: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0xab/0x190 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3496 [inline] kfree+0xcc/0x270 mm/slab.c:3815 bcm_remove_op+0x1cd/0x240 net/can/bcm.c:781 bcm_release+0xe7/0x500 net/can/bcm.c:1540 __sock_release+0xc2/0x2a0 net/socket.c:602 sock_close+0x10/0x20 net/socket.c:1139 __fput+0x232/0x740 fs/file_table.c:210 ____fput+0x9/0x10 fs/file_table.c:244 task_work_run+0xe5/0x170 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:191 [inline] exit_to_usermode_loop+0x14a/0x190 arch/x86/entry/common.c:164 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline] syscall_return_slowpath arch/x86/entry/common.c:270 [inline] do_syscall_64+0x416/0x5b0 arch/x86/entry/common.c:297 entry_SYSCALL_64_after_hwframe+0x46/0xbb The buggy address belongs to the object at ffff8881dde02d80 which belongs to the cache kmalloc-1024 of size 1024 The buggy address is located 336 bytes inside of 1024-byte region [ffff8881dde02d80, ffff8881dde03180) The buggy address belongs to the page: page:ffffea0007778080 count:1 mapcount:0 mapping:ffff8881dde02000 index:0xffff8881dde02900 compound_mapcount: 0 flags: 0x17ffe0000008100(slab|head) raw: 017ffe0000008100 ffff8881dde02000 ffff8881dde02900 0000000100000004 raw: ffffea0007b77b20 ffffea00077f3e20 ffff8881f6000ac0 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881dde02d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881dde02e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881dde02e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881dde02f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881dde02f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================