================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x30e0/0x4700 kernel/locking/lockdep.c:3215 Read of size 8 at addr ffff888096dd5860 by task syz-executor.1/18362 CPU: 0 PID: 18362 Comm: syz-executor.1 Not tainted 5.0.0-rc5+ #73 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.cold+0x7c/0x20d mm/kasan/report.c:187 kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:135 __lock_acquire+0x30e0/0x4700 kernel/locking/lockdep.c:3215 lock_acquire+0x16f/0x3f0 kernel/locking/lockdep.c:3841 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline] _raw_spin_lock_bh+0x33/0x50 kernel/locking/spinlock.c:168 spin_lock_bh include/linux/spinlock.h:334 [inline] __lock_sock+0x16d/0x290 net/core/sock.c:2261 lock_sock_nested+0xfe/0x120 net/core/sock.c:2785 lock_sock include/net/sock.h:1506 [inline] sctp_sock_dump+0x122/0xb20 net/sctp/diag.c:324 sctp_for_each_transport+0x2ba/0x360 net/sctp/socket.c:5139 sctp_diag_dump+0x33e/0x450 net/sctp/diag.c:527 __inet_diag_dump+0xa4/0x130 net/ipv4/inet_diag.c:1051 inet_diag_dump+0x9b/0x110 net/ipv4/inet_diag.c:1067 netlink_dump+0x55d/0xfb0 net/netlink/af_netlink.c:2244 __netlink_dump_start+0x5b4/0x7e0 net/netlink/af_netlink.c:2352 netlink_dump_start include/linux/netlink.h:225 [inline] inet_diag_handler_cmd+0x262/0x320 net/ipv4/inet_diag.c:1172 __sock_diag_cmd net/core/sock_diag.c:232 [inline] sock_diag_rcv_msg+0x322/0x410 net/core/sock_diag.c:263 netlink_rcv_skb+0x17a/0x460 net/netlink/af_netlink.c:2477 sock_diag_rcv+0x2b/0x40 net/core/sock_diag.c:274 netlink_unicast_kernel net/netlink/af_netlink.c:1310 [inline] netlink_unicast+0x536/0x720 net/netlink/af_netlink.c:1336 netlink_sendmsg+0x8ae/0xd70 net/netlink/af_netlink.c:1917 sock_sendmsg_nosec net/socket.c:621 [inline] sock_sendmsg+0xdd/0x130 net/socket.c:631 sock_write_iter+0x27c/0x3e0 net/socket.c:900 call_write_iter include/linux/fs.h:1863 [inline] do_iter_readv_writev+0x5e0/0x8e0 fs/read_write.c:680 do_iter_write fs/read_write.c:956 [inline] do_iter_write+0x184/0x610 fs/read_write.c:937 vfs_writev+0x1b3/0x2f0 fs/read_write.c:1001 do_writev+0xf6/0x290 fs/read_write.c:1036 __do_sys_writev fs/read_write.c:1109 [inline] __se_sys_writev fs/read_write.c:1106 [inline] __x64_sys_writev+0x75/0xb0 fs/read_write.c:1106 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x457e39 Code: ad b8 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 b8 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f9491dc4c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000014 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000457e39 RDX: 0000000000000001 RSI: 000000002051c000 RDI: 000000000000000a RBP: 000000000073c0e0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f9491dc56d4 R13: 00000000004c4976 R14: 00000000004dcfa0 R15: 00000000ffffffff Allocated by task 18328: save_stack+0x45/0xd0 mm/kasan/common.c:73 set_track mm/kasan/common.c:85 [inline] __kasan_kmalloc mm/kasan/common.c:496 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:469 kasan_kmalloc mm/kasan/common.c:504 [inline] kasan_slab_alloc+0xf/0x20 mm/kasan/common.c:411 kmem_cache_alloc+0x12d/0x710 mm/slab.c:3543 sk_prot_alloc+0x67/0x2e0 net/core/sock.c:1471 sk_alloc+0x39/0xf70 net/core/sock.c:1531 inet_create net/ipv4/af_inet.c:321 [inline] inet_create+0x36a/0xe10 net/ipv4/af_inet.c:247 __sock_create+0x3e6/0x750 net/socket.c:1275 sock_create net/socket.c:1315 [inline] __sys_socket+0x103/0x220 net/socket.c:1345 __do_sys_socket net/socket.c:1354 [inline] __se_sys_socket net/socket.c:1352 [inline] __x64_sys_socket+0x73/0xb0 net/socket.c:1352 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 18361: save_stack+0x45/0xd0 mm/kasan/common.c:73 set_track mm/kasan/common.c:85 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:458 kasan_slab_free+0xe/0x10 mm/kasan/common.c:466 __cache_free mm/slab.c:3487 [inline] kmem_cache_free+0x86/0x260 mm/slab.c:3749 sk_prot_free net/core/sock.c:1512 [inline] __sk_destruct+0x4b6/0x6d0 net/core/sock.c:1596 sk_destruct+0x7b/0x90 net/core/sock.c:1604 __sk_free+0xce/0x300 net/core/sock.c:1615 sk_free+0x42/0x50 net/core/sock.c:1626 sock_put include/net/sock.h:1707 [inline] sctp_close+0x70f/0x860 net/sctp/socket.c:1569 inet_release+0x105/0x1f0 net/ipv4/af_inet.c:428 __sock_release+0xd3/0x250 net/socket.c:579 sock_close+0x1b/0x30 net/socket.c:1139 __fput+0x2df/0x8d0 fs/file_table.c:278 ____fput+0x16/0x20 fs/file_table.c:309 task_work_run+0x14a/0x1c0 kernel/task_work.c:113 get_signal+0x1467/0x1750 kernel/signal.c:2347 do_signal+0x87/0x1940 arch/x86/kernel/signal.c:816 exit_to_usermode_loop+0x244/0x2c0 arch/x86/entry/common.c:162 prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline] syscall_return_slowpath arch/x86/entry/common.c:268 [inline] do_syscall_64+0x52d/0x610 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff888096dd57c0 which belongs to the cache SCTP(33:syz1) of size 1752 The buggy address is located 160 bytes inside of 1752-byte region [ffff888096dd57c0, ffff888096dd5e98) The buggy address belongs to the page: page:ffffea00025b7540 count:1 mapcount:0 mapping:ffff8880a94f1900 index:0xffff888096dd5040 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea00021f2f88 ffffea00027c3d08 ffff8880a94f1900 raw: ffff888096dd5040 ffff888096dd5040 0000000100000001 ffff888069074840 page dumped because: kasan: bad access detected page->mem_cgroup:ffff888069074840 Memory state around the buggy address: ffff888096dd5700: fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888096dd5780: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb >ffff888096dd5800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888096dd5880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888096dd5900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================