================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x32f9/0x4500 kernel/locking/lockdep.c:3365 Read of size 8 at addr ffff8880a16f78a0 by task syz-executor.0/19959 CPU: 0 PID: 19959 Comm: syz-executor.0 Not tainted 4.14.173-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0xf7/0x13b lib/dump_stack.c:58 print_address_description.cold.7+0x9/0x1c9 mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report.cold.8+0x11a/0x2d3 mm/kasan/report.c:409 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430 __lock_acquire+0x32f9/0x4500 kernel/locking/lockdep.c:3365 lock_acquire+0x173/0x400 kernel/locking/lockdep.c:3994 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline] _raw_spin_lock_bh+0x31/0x40 kernel/locking/spinlock.c:176 spin_lock_bh include/linux/spinlock.h:322 [inline] __lock_sock+0x129/0x1f0 net/core/sock.c:2241 lock_sock_nested+0xda/0x100 net/core/sock.c:2764 lock_sock include/net/sock.h:1467 [inline] sctp_sock_dump+0x10b/0xc70 net/sctp/sctp_diag.c:294 sctp_for_each_transport+0x1f8/0x270 net/sctp/socket.c:4748 sctp_diag_dump+0x253/0x4e0 net/sctp/sctp_diag.c:497 __inet_diag_dump+0x7f/0x110 net/ipv4/inet_diag.c:1053 inet_diag_dump+0x74/0xf0 net/ipv4/inet_diag.c:1069 netlink_dump+0x3bf/0xb70 net/netlink/af_netlink.c:2203 __netlink_dump_start+0x4c7/0x770 net/netlink/af_netlink.c:2300 netlink_dump_start include/linux/netlink.h:217 [inline] inet_diag_handler_cmd+0x1cd/0x2a0 net/ipv4/inet_diag.c:1174 __sock_diag_cmd net/core/sock_diag.c:231 [inline] sock_diag_rcv_msg+0x252/0x350 net/core/sock_diag.c:263 netlink_rcv_skb+0x133/0x370 net/netlink/af_netlink.c:2433 sock_diag_rcv+0x25/0x40 net/core/sock_diag.c:274 netlink_unicast_kernel net/netlink/af_netlink.c:1287 [inline] netlink_unicast+0x40b/0x600 net/netlink/af_netlink.c:1313 netlink_sendmsg+0x730/0xbd0 net/netlink/af_netlink.c:1878 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xb5/0xf0 net/socket.c:656 sock_write_iter+0x20d/0x400 net/socket.c:925 call_write_iter include/linux/fs.h:1777 [inline] do_iter_readv_writev+0x460/0x900 fs/read_write.c:675 do_iter_write+0x12b/0x520 fs/read_write.c:954 vfs_writev+0x145/0x2a0 fs/read_write.c:999 do_writev+0x10d/0x320 fs/read_write.c:1034 SYSC_writev fs/read_write.c:1107 [inline] SyS_writev+0xb/0x10 fs/read_write.c:1104 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x45b3b9 RSP: 002b:00007f20a3528c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000014 RAX: ffffffffffffffda RBX: 00007f20a35296d4 RCX: 000000000045b3b9 RDX: 0000000000000001 RSI: 0000000020000000 RDI: 000000000000000b RBP: 000000000075bfc8 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 0000000000000cdd R14: 00000000004c9cc2 R15: 000000000075bfd4 Allocated by task 19961: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:551 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:489 kmem_cache_alloc+0x12e/0x790 mm/slab.c:3552 sk_prot_alloc+0x5d/0x240 net/core/sock.c:1461 sk_alloc+0x30/0xc10 net/core/sock.c:1521 inet6_create+0x268/0xde0 net/ipv6/af_inet6.c:183 __sock_create+0x262/0x540 net/socket.c:1275 sock_create net/socket.c:1315 [inline] SYSC_socket net/socket.c:1345 [inline] SyS_socket+0xc6/0x1a0 net/socket.c:1325 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 Freed by task 19949: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0x71/0xc0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3496 [inline] kmem_cache_free+0x80/0x2d0 mm/slab.c:3758 sk_prot_free net/core/sock.c:1502 [inline] __sk_destruct+0x35f/0x5a0 net/core/sock.c:1581 sk_destruct+0x83/0xb0 net/core/sock.c:1596 __sk_free+0x47/0x1f0 net/core/sock.c:1604 sk_free+0x1a/0x20 net/core/sock.c:1615 sock_put include/net/sock.h:1658 [inline] sctp_close+0x429/0x710 net/sctp/socket.c:1589 inet_release+0xd9/0x1c0 net/ipv4/af_inet.c:425 inet6_release+0x46/0x60 net/ipv6/af_inet6.c:450 __sock_release+0xc2/0x2a0 net/socket.c:602 sock_close+0x10/0x20 net/socket.c:1139 __fput+0x232/0x750 fs/file_table.c:210 ____fput+0x9/0x10 fs/file_table.c:244 task_work_run+0xe5/0x170 kernel/task_work.c:113 get_signal+0x148c/0x1b30 kernel/signal.c:2229 do_signal+0x7f/0x19a0 arch/x86/kernel/signal.c:814 exit_to_usermode_loop+0x114/0x1b0 arch/x86/entry/common.c:160 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline] syscall_return_slowpath arch/x86/entry/common.c:270 [inline] do_syscall_64+0x416/0x5b0 arch/x86/entry/common.c:297 entry_SYSCALL_64_after_hwframe+0x42/0xb7 The buggy address belongs to the object at ffff8880a16f7800 which belongs to the cache SCTPv6 of size 1896 The buggy address is located 160 bytes inside of 1896-byte region [ffff8880a16f7800, ffff8880a16f7f68) The buggy address belongs to the page: page:ffffea000285bdc0 count:1 mapcount:0 mapping:ffff8880a16f7000 index:0x0 flags: 0xfffe0000000100(slab) raw: 00fffe0000000100 ffff8880a16f7000 0000000000000000 0000000100000002 raw: ffffea0002400aa0 ffffea00020968e0 ffff88809b3253c0 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a16f7780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880a16f7800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880a16f7880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880a16f7900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a16f7980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================