================================================================== BUG: KASAN: use-after-free in kernel_accept+0x2a4/0x310 net/socket.c:3241 Read of size 8 at addr ffff8801cbcb10a8 by task kworker/1:3/4911 CPU: 1 PID: 4911 Comm: kworker/1:3 Not tainted 4.18.0+ #109 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events smc_tcp_listen_work Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1c9/0x2b4 lib/dump_stack.c:113 print_address_description+0x6c/0x20b mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.7+0x242/0x30d mm/kasan/report.c:412 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 kernel_accept+0x2a4/0x310 net/socket.c:3241 smc_clcsock_accept net/smc/af_smc.c:831 [inline] smc_tcp_listen_work+0x218/0x11c0 net/smc/af_smc.c:1296 process_one_work+0xc73/0x1aa0 kernel/workqueue.c:2153 worker_thread+0x189/0x13c0 kernel/workqueue.c:2296 kthread+0x35a/0x420 kernel/kthread.c:246 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:413 Allocated by task 30692: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc4/0xe0 mm/kasan/kasan.c:553 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:490 kmem_cache_alloc+0x12e/0x710 mm/slab.c:3554 sock_alloc_inode+0x1d/0x260 net/socket.c:244 alloc_inode+0x63/0x190 fs/inode.c:210 new_inode_pseudo+0x71/0x1a0 fs/inode.c:903 sock_alloc+0x41/0x270 net/socket.c:547 __sock_create+0x175/0x940 net/socket.c:1239 sock_create_kern+0x3b/0x50 net/socket.c:1321 smc_create+0x17c/0x3b0 net/smc/af_smc.c:1901 __sock_create+0x53c/0x940 net/socket.c:1275 sock_create net/socket.c:1315 [inline] __sys_socket+0x106/0x260 net/socket.c:1345 __do_sys_socket net/socket.c:1354 [inline] __se_sys_socket net/socket.c:1352 [inline] __ia32_sys_socket+0x73/0xb0 net/socket.c:1352 do_syscall_32_irqs_on arch/x86/entry/common.c:326 [inline] do_fast_syscall_32+0x34d/0xfb2 arch/x86/entry/common.c:397 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 Freed by task 30692: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x11a/0x170 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3498 [inline] kmem_cache_free+0x86/0x280 mm/slab.c:3756 sock_destroy_inode+0x51/0x60 net/socket.c:272 destroy_inode+0x159/0x200 fs/inode.c:267 evict+0x5d5/0x990 fs/inode.c:575 iput_final fs/inode.c:1547 [inline] iput+0x5fa/0xa00 fs/inode.c:1573 __sock_release+0x1ec/0x250 net/socket.c:590 sock_release+0x17/0x20 net/socket.c:598 smc_release+0x1a8/0x730 net/smc/af_smc.c:148 __sock_release+0xd7/0x250 net/socket.c:579 sock_close+0x19/0x20 net/socket.c:1139 __fput+0x36e/0x8c0 fs/file_table.c:278 ____fput+0x15/0x20 fs/file_table.c:309 task_work_run+0x1e8/0x2a0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:193 [inline] exit_to_usermode_loop+0x318/0x380 arch/x86/entry/common.c:166 prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline] syscall_return_slowpath arch/x86/entry/common.c:268 [inline] do_syscall_32_irqs_on arch/x86/entry/common.c:341 [inline] do_fast_syscall_32+0xcd5/0xfb2 arch/x86/entry/common.c:397 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 The buggy address belongs to the object at ffff8801cbcb1080 which belongs to the cache sock_inode_cache(17:syz4) of size 984 The buggy address is located 40 bytes inside of 984-byte region [ffff8801cbcb1080, ffff8801cbcb1458) The buggy address belongs to the page: page:ffffea00072f2c40 count:1 mapcount:0 mapping:ffff8801aea667c0 index:0xffff8801cbcb1ffd flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffffea00072f8008 ffffea0006c93248 ffff8801aea667c0 raw: ffff8801cbcb1ffd ffff8801cbcb1080 0000000100000003 ffff8801afa36000 page dumped because: kasan: bad access detected page->mem_cgroup:ffff8801afa36000 Memory state around the buggy address: ffff8801cbcb0f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8801cbcb1000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8801cbcb1080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801cbcb1100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801cbcb1180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================