================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x3a8b/0x4a00 kernel/locking/lockdep.c:3828 Read of size 8 at addr ffff88805114d0c0 by task syz-executor.3/6573 CPU: 1 PID: 6573 Comm: syz-executor.3 Not tainted 5.4.0-rc6-next-20191108 #0 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+0x197/0x210 lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xd4/0x30b mm/kasan/report.c:374 __kasan_report.cold+0x1b/0x41 mm/kasan/report.c:506 kasan_report+0x12/0x20 mm/kasan/common.c:634 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:132 __lock_acquire+0x3a8b/0x4a00 kernel/locking/lockdep.c:3828 lock_acquire+0x190/0x410 kernel/locking/lockdep.c:4487 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline] _raw_spin_lock_bh+0x33/0x50 kernel/locking/spinlock.c:175 spin_lock_bh include/linux/spinlock.h:343 [inline] j1939_sk_recv+0x2f/0x370 net/can/j1939/socket.c:345 j1939_can_recv+0x4e5/0x620 net/can/j1939/main.c:105 deliver net/can/af_can.c:568 [inline] can_rcv_filter+0x292/0x8e0 net/can/af_can.c:602 can_receive+0x2e7/0x530 net/can/af_can.c:659 can_rcv+0x133/0x1b0 net/can/af_can.c:685 __netif_receive_skb_one_core+0x113/0x1a0 net/core/dev.c:5150 __netif_receive_skb+0x2c/0x1d0 net/core/dev.c:5264 process_backlog+0x206/0x750 net/core/dev.c:6096 napi_poll net/core/dev.c:6533 [inline] net_rx_action+0x508/0x1110 net/core/dev.c:6601 __do_softirq+0x262/0x98c kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x19b/0x1e0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:536 [inline] smp_apic_timer_interrupt+0x1a3/0x610 arch/x86/kernel/apic/apic.c:1137 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829 RIP: 0010:arch_local_irq_restore arch/x86/include/asm/paravirt.h:756 [inline] RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline] RIP: 0010:_raw_spin_unlock_irqrestore+0x90/0xe0 kernel/locking/spinlock.c:191 Code: 48 c7 c0 60 20 f3 88 48 ba 00 00 00 00 00 fc ff df 48 c1 e8 03 80 3c 10 00 75 39 48 83 3d d7 b5 9a 01 00 74 24 48 89 df 57 9d <0f> 1f 44 00 00 bf 01 00 00 00 e8 e1 eb f6 f9 65 8b 05 a2 93 a9 78 RSP: 0018:ffff8880a8a479c8 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff13 RAX: 1ffffffff11e640c RBX: 0000000000000286 RCX: 0000000000000000 RDX: dffffc0000000000 RSI: 0000000000000006 RDI: 0000000000000286 RBP: ffff8880a8a479d8 R08: ffff888057334580 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: ffff8880a0bf2ba0 R13: ffff8880a8a47a98 R14: ffff8880ae834d58 R15: ffff8880a0bf23c0 try_to_wake_up+0x756/0x1ab0 kernel/sched/core.c:2646 wake_up_process kernel/sched/core.c:2668 [inline] wake_up_q+0x99/0xf0 kernel/sched/core.c:496 futex_wake+0x429/0x4d0 kernel/futex.c:1636 do_futex+0x358/0x1de0 kernel/futex.c:3649 __do_sys_futex kernel/futex.c:3705 [inline] __se_sys_futex kernel/futex.c:3673 [inline] __x64_sys_futex+0x3f7/0x590 kernel/futex.c:3673 do_syscall_64+0xfa/0x760 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45a219 Code: ad b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f125b48ecf8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: ffffffffffffffda RBX: 000000000075bf28 RCX: 000000000045a219 RDX: 00000000004c7ab3 RSI: 0000000000000081 RDI: 000000000075bf2c RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000246 R12: 000000000075bf2c R13: 00007ffed9af96bf R14: 00007f125b48f9c0 R15: 000000000075bf2c Allocated by task 6573: save_stack+0x23/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc mm/kasan/common.c:510 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:483 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:524 kmem_cache_alloc_trace+0x158/0x790 mm/slab.c:3551 kmalloc include/linux/slab.h:556 [inline] kzalloc include/linux/slab.h:670 [inline] j1939_priv_create net/can/j1939/main.c:122 [inline] j1939_netdev_start+0xa4/0x550 net/can/j1939/main.c:251 j1939_sk_bind+0x65a/0x8e0 net/can/j1939/socket.c:438 __sys_bind+0x239/0x290 net/socket.c:1648 __do_sys_bind net/socket.c:1659 [inline] __se_sys_bind net/socket.c:1657 [inline] __x64_sys_bind+0x73/0xb0 net/socket.c:1657 do_syscall_64+0xfa/0x760 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 6573: save_stack+0x23/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] kasan_set_free_info mm/kasan/common.c:332 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:471 kasan_slab_free+0xe/0x10 mm/kasan/common.c:480 __cache_free mm/slab.c:3426 [inline] kfree+0x10a/0x2c0 mm/slab.c:3757 __j1939_priv_release net/can/j1939/main.c:154 [inline] kref_put include/linux/kref.h:65 [inline] j1939_priv_put+0x8b/0xb0 net/can/j1939/main.c:159 j1939_session_destroy net/can/j1939/transport.c:271 [inline] __j1939_session_release net/can/j1939/transport.c:280 [inline] kref_put include/linux/kref.h:65 [inline] j1939_session_put+0x12c/0x180 net/can/j1939/transport.c:285 j1939_simple_recv+0x271/0x350 net/can/j1939/transport.c:2018 j1939_can_recv+0x4da/0x620 net/can/j1939/main.c:104 deliver net/can/af_can.c:568 [inline] can_rcv_filter+0x292/0x8e0 net/can/af_can.c:602 can_receive+0x2e7/0x530 net/can/af_can.c:659 can_rcv+0x133/0x1b0 net/can/af_can.c:685 __netif_receive_skb_one_core+0x113/0x1a0 net/core/dev.c:5150 __netif_receive_skb+0x2c/0x1d0 net/core/dev.c:5264 process_backlog+0x206/0x750 net/core/dev.c:6096 napi_poll net/core/dev.c:6533 [inline] net_rx_action+0x508/0x1110 net/core/dev.c:6601 __do_softirq+0x262/0x98c kernel/softirq.c:292 The buggy address belongs to the object at ffff88805114c000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 4288 bytes inside of 8192-byte region [ffff88805114c000, ffff88805114e000) The buggy address belongs to the page: page:ffffea0001445300 refcount:1 mapcount:0 mapping:ffff8880aa4021c0 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea00017e0008 ffffea0002641f08 ffff8880aa4021c0 raw: 0000000000000000 ffff88805114c000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88805114cf80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805114d000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88805114d080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88805114d100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805114d180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================