================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x3a8b/0x4a00 kernel/locking/lockdep.c:3828 Read of size 8 at addr ffff888097dc8560 by task syz-executor.4/11358 CPU: 1 PID: 11358 Comm: syz-executor.4 Not tainted 5.4.0-rc5+ #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+0x172/0x1f0 lib/dump_stack.c:113 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] __lock_sock+0x16d/0x290 net/core/sock.c:2416 lock_sock_nested+0xfe/0x120 net/core/sock.c:2940 lock_sock include/net/sock.h:1527 [inline] sctp_sock_dump+0x122/0xb20 net/sctp/diag.c:310 sctp_for_each_transport+0x2b4/0x350 net/sctp/socket.c:5404 sctp_diag_dump+0x33e/0x450 net/sctp/diag.c:513 __inet_diag_dump+0x9e/0x130 net/ipv4/inet_diag.c:1055 inet_diag_dump+0x9b/0x110 net/ipv4/inet_diag.c:1071 netlink_dump+0x558/0xfb0 net/netlink/af_netlink.c:2244 __netlink_dump_start+0x5b1/0x7d0 net/netlink/af_netlink.c:2352 netlink_dump_start include/linux/netlink.h:233 [inline] inet_diag_handler_cmd+0x262/0x320 net/ipv4/inet_diag.c:1176 __sock_diag_cmd net/core/sock_diag.c:233 [inline] sock_diag_rcv_msg+0x319/0x410 net/core/sock_diag.c:264 netlink_rcv_skb+0x177/0x450 net/netlink/af_netlink.c:2477 sock_diag_rcv+0x2b/0x40 net/core/sock_diag.c:275 netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline] netlink_unicast+0x531/0x710 net/netlink/af_netlink.c:1328 netlink_sendmsg+0x8a5/0xd60 net/netlink/af_netlink.c:1917 sock_sendmsg_nosec net/socket.c:637 [inline] sock_sendmsg+0xd7/0x130 net/socket.c:657 sock_write_iter+0x27c/0x3e0 net/socket.c:989 call_write_iter include/linux/fs.h:1895 [inline] do_iter_readv_writev+0x5f8/0x8f0 fs/read_write.c:693 do_iter_write fs/read_write.c:970 [inline] do_iter_write+0x184/0x610 fs/read_write.c:951 vfs_writev+0x1b3/0x2f0 fs/read_write.c:1015 do_writev+0x15b/0x330 fs/read_write.c:1058 __do_sys_writev fs/read_write.c:1131 [inline] __se_sys_writev fs/read_write.c:1128 [inline] __x64_sys_writev+0x75/0xb0 fs/read_write.c:1128 do_syscall_64+0xfa/0x760 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x459f49 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:00007ff703ce9c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000014 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000459f49 RDX: 0000000000000001 RSI: 0000000020000240 RDI: 0000000000000003 RBP: 000000000075c070 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007ff703cea6d4 R13: 00000000004c779b R14: 00000000004e2fd0 R15: 00000000ffffffff Allocated by task 11356: 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_slab_alloc+0xf/0x20 mm/kasan/common.c:518 slab_post_alloc_hook mm/slab.h:584 [inline] slab_alloc mm/slab.c:3319 [inline] kmem_cache_alloc+0x121/0x710 mm/slab.c:3483 sk_prot_alloc+0x67/0x310 net/core/sock.c:1599 sk_alloc+0x39/0xf70 net/core/sock.c:1659 inet6_create net/ipv6/af_inet6.c:180 [inline] inet6_create+0x360/0xf80 net/ipv6/af_inet6.c:107 __sock_create+0x3d8/0x730 net/socket.c:1418 sock_create net/socket.c:1469 [inline] __sys_socket+0x103/0x220 net/socket.c:1511 __do_sys_socket net/socket.c:1520 [inline] __se_sys_socket net/socket.c:1518 [inline] __x64_sys_socket+0x73/0xb0 net/socket.c:1518 do_syscall_64+0xfa/0x760 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 11347: 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:3425 [inline] kmem_cache_free+0x86/0x320 mm/slab.c:3693 sk_prot_free net/core/sock.c:1640 [inline] __sk_destruct+0x481/0x680 net/core/sock.c:1726 sk_destruct+0xd5/0x110 net/core/sock.c:1741 __sk_free+0xfb/0x360 net/core/sock.c:1752 sk_free+0x42/0x50 net/core/sock.c:1763 sock_put include/net/sock.h:1730 [inline] sctp_close+0x72b/0x880 net/sctp/socket.c:1542 inet_release+0xed/0x200 net/ipv4/af_inet.c:427 inet6_release+0x53/0x80 net/ipv6/af_inet6.c:470 __sock_release+0xce/0x280 net/socket.c:590 sock_close+0x1e/0x30 net/socket.c:1268 __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 get_signal+0x2078/0x2500 kernel/signal.c:2528 do_signal+0x87/0x1700 arch/x86/kernel/signal.c:815 exit_to_usermode_loop+0x286/0x380 arch/x86/entry/common.c:159 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 ffff888097dc84c0 which belongs to the cache SCTPv6(97:syz4) of size 1960 The buggy address is located 160 bytes inside of 1960-byte region [ffff888097dc84c0, ffff888097dc8c68) The buggy address belongs to the page: page:ffffea00025f7200 refcount:1 mapcount:0 mapping:ffff8880a70a9e00 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea00029f8088 ffffea0002910288 ffff8880a70a9e00 raw: 0000000000000000 ffff888097dc84c0 0000000100000003 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888097dc8400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888097dc8480: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb >ffff888097dc8500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888097dc8580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888097dc8600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================