================================================================== BUG: KASAN: use-after-free in register_lock_class+0x1235/0x1850 kernel/locking/lockdep.c:1263 Write of size 8 at addr ffff888091ce24e8 by task ksoftirqd/1/16 CPU: 1 PID: 16 Comm: ksoftirqd/1 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_store8_noabort+0x17/0x20 mm/kasan/generic_report.c:137 register_lock_class+0x1235/0x1850 kernel/locking/lockdep.c:1263 __lock_acquire+0xf4/0x4a00 kernel/locking/lockdep.c:3837 lock_acquire+0x190/0x410 kernel/locking/lockdep.c:4487 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x95/0xcd kernel/locking/spinlock.c:159 __wake_up_common_lock+0xc8/0x150 kernel/sched/wait.c:122 __wake_up+0xe/0x10 kernel/sched/wait.c:142 j1939_sock_pending_del+0x69/0x80 net/can/j1939/socket.c:74 __j1939_session_drop net/can/j1939/transport.c:257 [inline] j1939_session_destroy net/can/j1939/transport.c:270 [inline] __j1939_session_release net/can/j1939/transport.c:280 [inline] kref_put include/linux/kref.h:65 [inline] j1939_session_put+0x107/0x180 net/can/j1939/transport.c:285 j1939_xtp_rx_eoma+0x24f/0x390 net/can/j1939/transport.c:1318 j1939_tp_cmd_recv net/can/j1939/transport.c:1952 [inline] j1939_tp_recv+0x32a/0x9b0 net/can/j1939/transport.c:1991 j1939_can_recv+0x4bb/0x620 net/can/j1939/main.c:100 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 run_ksoftirqd kernel/softirq.c:603 [inline] run_ksoftirqd+0x8e/0x110 kernel/softirq.c:595 smpboot_thread_fn+0x6a3/0xa40 kernel/smpboot.c:165 kthread+0x361/0x430 kernel/kthread.c:255 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 Allocated by task 6078: 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 __do_kmalloc mm/slab.c:3656 [inline] __kmalloc+0x163/0x770 mm/slab.c:3665 kmalloc include/linux/slab.h:561 [inline] sk_prot_alloc+0x23a/0x310 net/core/sock.c:1603 sk_alloc+0x39/0xf70 net/core/sock.c:1657 can_create+0x1e7/0x4b0 net/can/af_can.c:157 __sock_create+0x3ce/0x730 net/socket.c:1419 sock_create net/socket.c:1470 [inline] __sys_socket+0x103/0x220 net/socket.c:1512 __do_sys_socket net/socket.c:1521 [inline] __se_sys_socket net/socket.c:1519 [inline] __x64_sys_socket+0x73/0xb0 net/socket.c:1519 do_syscall_64+0xfa/0x760 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 6075: 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 sk_prot_free net/core/sock.c:1640 [inline] __sk_destruct+0x4aa/0x680 net/core/sock.c:1724 sk_destruct+0xd5/0x110 net/core/sock.c:1739 __sk_free+0xfb/0x360 net/core/sock.c:1750 sk_free+0x42/0x50 net/core/sock.c:1761 sock_put include/net/sock.h:1729 [inline] j1939_sk_release+0x3cf/0x5c0 net/can/j1939/socket.c:588 __sock_release+0xce/0x280 net/socket.c:591 sock_close+0x1e/0x30 net/socket.c:1269 __fput+0x2ff/0x890 fs/file_table.c:280 ____fput+0x16/0x20 fs/file_table.c:313 task_work_run+0x145/0x1c0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop+0x316/0x380 arch/x86/entry/common.c:163 prepare_exit_to_usermode arch/x86/entry/common.c:194 [inline] syscall_return_slowpath arch/x86/entry/common.c:274 [inline] do_syscall_64+0x65f/0x760 arch/x86/entry/common.c:300 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff888091ce2000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 1256 bytes inside of 2048-byte region [ffff888091ce2000, ffff888091ce2800) The buggy address belongs to the page: page:ffffea0002473880 refcount:1 mapcount:0 mapping:ffff8880aa400e00 index:0x0 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea000293c488 ffffea0001672408 ffff8880aa400e00 raw: 0000000000000000 ffff888091ce2000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888091ce2380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888091ce2400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888091ce2480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888091ce2500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888091ce2580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================