================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x32a3/0x3ca0 kernel/locking/lockdep.c:3827 Read of size 8 at addr ffff888094bde2e0 by task syz-executor.1/12703 CPU: 1 PID: 12703 Comm: syz-executor.1 Not tainted 5.6.0-rc3-syzkaller #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+0x188/0x20d lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xd3/0x315 mm/kasan/report.c:374 __kasan_report.cold+0x1a/0x32 mm/kasan/report.c:506 kasan_report+0xe/0x20 mm/kasan/common.c:641 __lock_acquire+0x32a3/0x3ca0 kernel/locking/lockdep.c:3827 lock_acquire+0x197/0x420 kernel/locking/lockdep.c:4484 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline] _raw_spin_lock_bh+0x2f/0x40 kernel/locking/spinlock.c:175 spin_lock_bh include/linux/spinlock.h:343 [inline] __lock_sock+0x145/0x260 net/core/sock.c:2422 lock_sock_nested+0xf1/0x110 net/core/sock.c:2946 lock_sock include/net/sock.h:1574 [inline] sctp_sock_dump+0x125/0xad0 net/sctp/diag.c:310 sctp_for_each_transport+0x27c/0x310 net/sctp/socket.c:5458 sctp_diag_dump+0x2fd/0x3f0 net/sctp/diag.c:514 __inet_diag_dump+0x8d/0x240 net/ipv4/inet_diag.c:1079 netlink_dump+0x50b/0xf50 net/netlink/af_netlink.c:2245 __netlink_dump_start+0x63f/0x910 net/netlink/af_netlink.c:2353 netlink_dump_start include/linux/netlink.h:233 [inline] inet_diag_handler_cmd+0x263/0x2c0 net/ipv4/inet_diag.c:1244 __sock_diag_cmd net/core/sock_diag.c:233 [inline] sock_diag_rcv_msg+0x2fe/0x3e0 net/core/sock_diag.c:264 netlink_rcv_skb+0x15a/0x410 net/netlink/af_netlink.c:2478 sock_diag_rcv+0x26/0x40 net/core/sock_diag.c:275 netlink_unicast_kernel net/netlink/af_netlink.c:1303 [inline] netlink_unicast+0x537/0x740 net/netlink/af_netlink.c:1329 netlink_sendmsg+0x882/0xe10 net/netlink/af_netlink.c:1918 sock_sendmsg_nosec net/socket.c:652 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:672 sock_write_iter+0x283/0x3c0 net/socket.c:1004 call_write_iter include/linux/fs.h:1901 [inline] do_iter_readv_writev+0x59c/0x840 fs/read_write.c:693 do_iter_write fs/read_write.c:998 [inline] do_iter_write+0x185/0x600 fs/read_write.c:979 vfs_writev+0x1b3/0x2f0 fs/read_write.c:1071 do_writev+0x279/0x2f0 fs/read_write.c:1114 do_syscall_64+0xf6/0x790 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45c679 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:00007fc8b1bcdc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000014 RAX: ffffffffffffffda RBX: 00007fc8b1bce6d4 RCX: 000000000045c679 RDX: 0000000000000001 RSI: 0000000020000000 RDI: 0000000000000006 RBP: 000000000076bfa0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 0000000000000d10 R14: 00000000004cafd4 R15: 000000000076bfac Allocated by task 12703: save_stack+0x1b/0x80 mm/kasan/common.c:72 set_track mm/kasan/common.c:80 [inline] __kasan_kmalloc mm/kasan/common.c:515 [inline] __kasan_kmalloc.constprop.0+0xbf/0xd0 mm/kasan/common.c:488 slab_post_alloc_hook mm/slab.h:584 [inline] slab_alloc mm/slab.c:3320 [inline] kmem_cache_alloc+0x11b/0x730 mm/slab.c:3484 sk_prot_alloc+0x5f/0x2f0 net/core/sock.c:1598 sk_alloc+0x36/0xfa0 net/core/sock.c:1658 inet6_create net/ipv6/af_inet6.c:180 [inline] inet6_create+0x35b/0xf80 net/ipv6/af_inet6.c:107 __sock_create+0x3cb/0x730 net/socket.c:1433 sock_create net/socket.c:1484 [inline] __sys_socket+0xef/0x200 net/socket.c:1526 __do_sys_socket net/socket.c:1535 [inline] __se_sys_socket net/socket.c:1533 [inline] __x64_sys_socket+0x6f/0xb0 net/socket.c:1533 do_syscall_64+0xf6/0x790 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 12690: save_stack+0x1b/0x80 mm/kasan/common.c:72 set_track mm/kasan/common.c:80 [inline] kasan_set_free_info mm/kasan/common.c:337 [inline] __kasan_slab_free+0xf7/0x140 mm/kasan/common.c:476 __cache_free mm/slab.c:3426 [inline] kmem_cache_free+0x7f/0x320 mm/slab.c:3694 sk_prot_free net/core/sock.c:1639 [inline] __sk_destruct+0x4c2/0x7c0 net/core/sock.c:1725 sk_destruct+0xc6/0x100 net/core/sock.c:1740 __sk_free+0xef/0x3d0 net/core/sock.c:1751 sk_free+0x78/0xa0 net/core/sock.c:1762 sock_put include/net/sock.h:1777 [inline] sctp_close+0x72b/0x8a0 net/sctp/socket.c:1541 inet_release+0xe4/0x1f0 net/ipv4/af_inet.c:427 inet6_release+0x4c/0x70 net/ipv6/af_inet6.c:470 __sock_release+0xcd/0x280 net/socket.c:605 sock_close+0x18/0x20 net/socket.c:1283 __fput+0x2da/0x850 fs/file_table.c:280 task_work_run+0x13f/0x1b0 kernel/task_work.c:113 get_signal+0x2054/0x24e0 kernel/signal.c:2533 do_signal+0x7e/0x13f0 arch/x86/kernel/signal.c:813 exit_to_usermode_loop+0x26c/0x360 arch/x86/entry/common.c:160 prepare_exit_to_usermode arch/x86/entry/common.c:195 [inline] syscall_return_slowpath arch/x86/entry/common.c:278 [inline] do_syscall_64+0x672/0x790 arch/x86/entry/common.c:304 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff888094bde240 which belongs to the cache SCTPv6(33:syz1) of size 1960 The buggy address is located 160 bytes inside of 1960-byte region [ffff888094bde240, ffff888094bde9e8) The buggy address belongs to the page: page:ffffea000252f780 refcount:1 mapcount:0 mapping:ffff88807e116c40 index:0x0 compound_mapcount: 0 flags: 0xfffe0000010200(slab|head) raw: 00fffe0000010200 ffffea00025e1588 ffffea0001ef1408 ffff88807e116c40 raw: 0000000000000000 ffff888094bde240 0000000100000003 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888094bde180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888094bde200: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb >ffff888094bde280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888094bde300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888094bde380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================