========================= WARNING: held lock freed! 5.2.0-rc6+ #1 Not tainted ------------------------- syz-executor.3/7675 is freeing memory ffff888079256e80-ffff88807925767f, with a lock still held there! 0000000033702ed4 (sk_lock-AF_NETROM){+.+.}, at: lock_sock include/net/sock.h:1522 [inline] 0000000033702ed4 (sk_lock-AF_NETROM){+.+.}, at: nr_release+0x102/0x360 net/netrom/af_netrom.c:522 2 locks held by syz-executor.3/7675: #0: 0000000052cb167e (&sb->s_type->i_mutex_key#11){+.+.}, at: inode_lock include/linux/fs.h:778 [inline] #0: 0000000052cb167e (&sb->s_type->i_mutex_key#11){+.+.}, at: __sock_release+0x7d/0x290 net/socket.c:600 #1: 0000000033702ed4 (sk_lock-AF_NETROM){+.+.}, at: lock_sock include/net/sock.h:1522 [inline] #1: 0000000033702ed4 (sk_lock-AF_NETROM){+.+.}, at: nr_release+0x102/0x360 net/netrom/af_netrom.c:522 stack backtrace: CPU: 0 PID: 7675 Comm: syz-executor.3 Not tainted 5.2.0-rc6+ #1 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+0x113/0x167 lib/dump_stack.c:113 print_freed_lock_bug kernel/locking/lockdep.c:5077 [inline] debug_check_no_locks_freed.cold.56+0x9e/0xaa kernel/locking/lockdep.c:5110 kfree+0xb1/0x220 mm/slab.c:3752 sk_prot_free net/core/sock.c:1636 [inline] __sk_destruct+0x3f1/0x580 net/core/sock.c:1722 sk_destruct+0x49/0x60 net/core/sock.c:1730 __sk_free+0x9e/0x230 net/core/sock.c:1741 sk_free+0x23/0x30 net/core/sock.c:1752 sock_put include/net/sock.h:1725 [inline] nr_destroy_socket+0x362/0x420 net/netrom/af_netrom.c:288 nr_release+0x2c9/0x360 net/netrom/af_netrom.c:530 __sock_release+0xc2/0x290 net/socket.c:601 sock_close+0x10/0x20 net/socket.c:1273 __fput+0x25a/0x770 fs/file_table.c:280 ____fput+0x9/0x10 fs/file_table.c:313 task_work_run+0x108/0x180 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0x9ca/0x2e80 kernel/exit.c:877 do_group_exit+0xf4/0x2f0 kernel/exit.c:981 get_signal+0x362/0x1cf0 kernel/signal.c:2640 do_signal+0x87/0x1940 arch/x86/kernel/signal.c:815 exit_to_usermode_loop+0x114/0x200 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:279 [inline] do_syscall_64+0x447/0x530 arch/x86/entry/common.c:304 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x459829 Code: Bad RIP value. RSP: 002b:00007f502b76ec78 EFLAGS: 00000246 ORIG_RAX: 0000000000000110 RAX: fffffffffffffffc RBX: 0000000000000001 RCX: 0000000000459829 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000040000000 RBP: 000000000075c118 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f502b76f6d4 R13: 00000000004c8f3a R14: 00000000004dfff0 R15: 00000000ffffffff ================================================================== BUG: KASAN: use-after-free in debug_spin_lock_before kernel/locking/spinlock_debug.c:83 [inline] BUG: KASAN: use-after-free in do_raw_spin_lock+0x282/0x2d0 kernel/locking/spinlock_debug.c:112 Read of size 4 at addr ffff888079256f0c by task syz-executor.3/7675 CPU: 0 PID: 7675 Comm: syz-executor.3 Not tainted 5.2.0-rc6+ #1 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+0x113/0x167 lib/dump_stack.c:113 print_address_description.cold.5+0x9/0x1ff mm/kasan/report.c:188 __kasan_report.cold.6+0x1b/0x39 mm/kasan/report.c:317 kasan_report+0x12/0x20 mm/kasan/common.c:614 __asan_report_load4_noabort+0x14/0x20 mm/kasan/generic_report.c:131 debug_spin_lock_before kernel/locking/spinlock_debug.c:83 [inline] do_raw_spin_lock+0x282/0x2d0 kernel/locking/spinlock_debug.c:112 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:136 [inline] _raw_spin_lock_bh+0x39/0x40 kernel/locking/spinlock.c:175 spin_lock_bh include/linux/spinlock.h:343 [inline] release_sock+0x1b/0x180 net/core/sock.c:2928 nr_release+0x168/0x360 net/netrom/af_netrom.c:553 __sock_release+0xc2/0x290 net/socket.c:601 sock_close+0x10/0x20 net/socket.c:1273 __fput+0x25a/0x770 fs/file_table.c:280 ____fput+0x9/0x10 fs/file_table.c:313 task_work_run+0x108/0x180 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0x9ca/0x2e80 kernel/exit.c:877 do_group_exit+0xf4/0x2f0 kernel/exit.c:981 get_signal+0x362/0x1cf0 kernel/signal.c:2640 do_signal+0x87/0x1940 arch/x86/kernel/signal.c:815 exit_to_usermode_loop+0x114/0x200 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:279 [inline] do_syscall_64+0x447/0x530 arch/x86/entry/common.c:304 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x459829 Code: Bad RIP value. RSP: 002b:00007f502b76ec78 EFLAGS: 00000246 ORIG_RAX: 0000000000000110 RAX: fffffffffffffffc RBX: 0000000000000001 RCX: 0000000000459829 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000040000000 RBP: 000000000075c118 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f502b76f6d4 R13: 00000000004c8f3a R14: 00000000004dfff0 R15: 00000000ffffffff Allocated by task 7656: save_stack+0x21/0x90 mm/kasan/common.c:71 set_track mm/kasan/common.c:79 [inline] __kasan_kmalloc.constprop.8+0xc7/0xd0 mm/kasan/common.c:489 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:503 __do_kmalloc mm/slab.c:3660 [inline] __kmalloc+0x15d/0x760 mm/slab.c:3669 kmalloc include/linux/slab.h:552 [inline] sk_prot_alloc+0x148/0x240 net/core/sock.c:1599 sk_alloc+0x30/0xc70 net/core/sock.c:1653 nr_make_new net/netrom/af_netrom.c:476 [inline] nr_rx_frame+0x645/0x1f00 net/netrom/af_netrom.c:959 nr_loopback_timer+0x64/0x120 net/netrom/nr_loopback.c:59 call_timer_fn+0x14d/0x510 kernel/time/timer.c:1322 expire_timers kernel/time/timer.c:1366 [inline] __run_timers kernel/time/timer.c:1685 [inline] run_timer_softirq+0xc6f/0x1330 kernel/time/timer.c:1698 __do_softirq+0x260/0x958 kernel/softirq.c:292 Freed by task 7675: save_stack+0x21/0x90 mm/kasan/common.c:71 set_track mm/kasan/common.c:79 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:451 kasan_slab_free+0xe/0x10 mm/kasan/common.c:459 __cache_free mm/slab.c:3432 [inline] kfree+0xcf/0x220 mm/slab.c:3755 sk_prot_free net/core/sock.c:1636 [inline] __sk_destruct+0x3f1/0x580 net/core/sock.c:1722 sk_destruct+0x49/0x60 net/core/sock.c:1730 __sk_free+0x9e/0x230 net/core/sock.c:1741 sk_free+0x23/0x30 net/core/sock.c:1752 sock_put include/net/sock.h:1725 [inline] nr_destroy_socket+0x362/0x420 net/netrom/af_netrom.c:288 nr_release+0x2c9/0x360 net/netrom/af_netrom.c:530 __sock_release+0xc2/0x290 net/socket.c:601 sock_close+0x10/0x20 net/socket.c:1273 __fput+0x25a/0x770 fs/file_table.c:280 ____fput+0x9/0x10 fs/file_table.c:313 task_work_run+0x108/0x180 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0x9ca/0x2e80 kernel/exit.c:877 do_group_exit+0xf4/0x2f0 kernel/exit.c:981 get_signal+0x362/0x1cf0 kernel/signal.c:2640 do_signal+0x87/0x1940 arch/x86/kernel/signal.c:815 exit_to_usermode_loop+0x114/0x200 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:279 [inline] do_syscall_64+0x447/0x530 arch/x86/entry/common.c:304 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff888079256e80 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 140 bytes inside of 2048-byte region [ffff888079256e80, ffff888079257680) The buggy address belongs to the page: page:ffffea0001e49580 refcount:1 mapcount:0 mapping:ffff8880aa400c40 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea0001e49188 ffffea0001e49708 ffff8880aa400c40 raw: 0000000000000000 ffff888079256600 0000000100000003 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888079256e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888079256e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888079256f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888079256f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888079257000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================