bisecting fixing commit since 2fe1020d73ca0467b5383b0a3e459a1d29902762 building syzkaller on 744a39e220cece33e207035facce6c5ae161b775 testing commit 2fe1020d73ca0467b5383b0a3e459a1d29902762 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: e79b672669fe54c5884bc5baf72c15d77131f4e0a03e163eb27008021c2053b6 all runs: crashed: KASAN: slab-out-of-bounds Read in sk_psock_get testing current HEAD b13baccc3850ca8b8cccbf8ed9912dbaa0fdf7f3 testing commit b13baccc3850ca8b8cccbf8ed9912dbaa0fdf7f3 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 726ea8f1af8101feb9737b3cee600fafe31ec1d0a70db5f36809b2b4a864195b all runs: crashed: KASAN: slab-out-of-bounds Read in sk_psock_get revisions tested: 2, total time: 22m14.544043765s (build: 13m33.020895839s, test: 8m7.061666003s) the crash still happens on HEAD commit msg: Linux 5.19-rc2 crash: KASAN: slab-out-of-bounds Read in sk_psock_get ================================================================== BUG: KASAN: slab-out-of-bounds in instrument_atomic_read include/linux/instrumented.h:71 [inline] BUG: KASAN: slab-out-of-bounds in atomic_read include/linux/atomic/atomic-instrumented.h:27 [inline] BUG: KASAN: slab-out-of-bounds in refcount_read include/linux/refcount.h:147 [inline] BUG: KASAN: slab-out-of-bounds in __refcount_add_not_zero include/linux/refcount.h:152 [inline] BUG: KASAN: slab-out-of-bounds in __refcount_inc_not_zero include/linux/refcount.h:227 [inline] BUG: KASAN: slab-out-of-bounds in refcount_inc_not_zero include/linux/refcount.h:245 [inline] BUG: KASAN: slab-out-of-bounds in sk_psock_get+0xe4/0x2c0 include/linux/skmsg.h:439 Read of size 4 at addr ffff88807d2cfe78 by task syz-executor.0/4091 CPU: 0 PID: 4091 Comm: syz-executor.0 Not tainted 5.19.0-rc2-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x57/0x7d lib/dump_stack.c:106 print_address_description.constprop.0.cold+0xeb/0x467 mm/kasan/report.c:313 print_report mm/kasan/report.c:429 [inline] kasan_report.cold+0xf4/0x1c6 mm/kasan/report.c:491 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189 instrument_atomic_read include/linux/instrumented.h:71 [inline] atomic_read include/linux/atomic/atomic-instrumented.h:27 [inline] refcount_read include/linux/refcount.h:147 [inline] __refcount_add_not_zero include/linux/refcount.h:152 [inline] __refcount_inc_not_zero include/linux/refcount.h:227 [inline] refcount_inc_not_zero include/linux/refcount.h:245 [inline] sk_psock_get+0xe4/0x2c0 include/linux/skmsg.h:439 tls_sw_recvmsg+0x134/0x1330 net/tls/tls_sw.c:1747 inet6_recvmsg+0xf0/0x490 net/ipv6/af_inet6.c:671 sock_recvmsg_nosec net/socket.c:995 [inline] sock_recvmsg net/socket.c:1013 [inline] sock_recvmsg net/socket.c:1009 [inline] ____sys_recvmsg+0x262/0x630 net/socket.c:2711 ___sys_recvmsg+0xe2/0x1a0 net/socket.c:2753 do_recvmmsg+0x1cf/0x550 net/socket.c:2847 __sys_recvmmsg net/socket.c:2926 [inline] __do_sys_recvmmsg net/socket.c:2949 [inline] __se_sys_recvmmsg net/socket.c:2942 [inline] __x64_sys_recvmmsg+0x19a/0x200 net/socket.c:2942 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 RIP: 0033:0x7f5cc1c890e9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f5cc13fe168 EFLAGS: 00000246 ORIG_RAX: 000000000000012b RAX: ffffffffffffffda RBX: 00007f5cc1d9bf60 RCX: 00007f5cc1c890e9 RDX: 000000000000000a RSI: 00000000200030c0 RDI: 0000000000000005 RBP: 00007f5cc1ce308d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000010000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffd626d7c0f R14: 00007f5cc13fe300 R15: 0000000000022000 Allocated by task 4095: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:436 [inline] __kasan_slab_alloc+0x85/0xb0 mm/kasan/common.c:469 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:750 [inline] slab_alloc mm/slab.c:3302 [inline] __kmem_cache_alloc_lru mm/slab.c:3479 [inline] kmem_cache_alloc+0x265/0x560 mm/slab.c:3499 kmem_cache_zalloc include/linux/slab.h:723 [inline] kcm_attach net/kcm/kcmsock.c:1405 [inline] kcm_attach_ioctl net/kcm/kcmsock.c:1490 [inline] kcm_ioctl+0x3d2/0x10b0 net/kcm/kcmsock.c:1696 sock_do_ioctl+0xc9/0x1c0 net/socket.c:1169 sock_ioctl+0x278/0x510 net/socket.c:1286 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __x64_sys_ioctl+0x11f/0x190 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0x7e/0x90 mm/kasan/generic.c:348 insert_work+0x43/0x2e0 kernel/workqueue.c:1358 __queue_work+0x4e6/0xdc0 kernel/workqueue.c:1517 queue_work_on+0x70/0x80 kernel/workqueue.c:1545 kcm_attach net/kcm/kcmsock.c:1466 [inline] kcm_attach_ioctl net/kcm/kcmsock.c:1490 [inline] kcm_ioctl+0xc79/0x10b0 net/kcm/kcmsock.c:1696 sock_do_ioctl+0xc9/0x1c0 net/socket.c:1169 sock_ioctl+0x278/0x510 net/socket.c:1286 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __x64_sys_ioctl+0x11f/0x190 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 The buggy address belongs to the object at ffff88807d2cfbc0 which belongs to the cache kcm_psock_cache of size 568 The buggy address is located 128 bytes to the right of 568-byte region [ffff88807d2cfbc0, ffff88807d2cfdf8) The buggy address belongs to the physical page: page:ffffea0001f4b380 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7d2ce head:ffffea0001f4b380 order:1 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffff888027505a50 ffff888027505a50 ffff8880258b0900 raw: 0000000000000000 ffff88807d2ce040 000000010000000b 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0x3420c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_COMP|__GFP_HARDWALL|__GFP_THISNODE), pid 4095, tgid 4090 (syz-executor.0), ts 76033585090, free_ts 76008148912 prep_new_page mm/page_alloc.c:2456 [inline] get_page_from_freelist+0x19d3/0x3b30 mm/page_alloc.c:4198 __alloc_pages+0x1c7/0x510 mm/page_alloc.c:5426 __alloc_pages_node include/linux/gfp.h:587 [inline] kmem_getpages mm/slab.c:1363 [inline] cache_grow_begin+0x75/0x350 mm/slab.c:2569 cache_alloc_refill+0x27f/0x380 mm/slab.c:2942 ____cache_alloc mm/slab.c:3024 [inline] ____cache_alloc mm/slab.c:3007 [inline] __do_cache_alloc mm/slab.c:3253 [inline] slab_alloc mm/slab.c:3295 [inline] __kmem_cache_alloc_lru mm/slab.c:3479 [inline] kmem_cache_alloc+0x450/0x560 mm/slab.c:3499 kmem_cache_zalloc include/linux/slab.h:723 [inline] kcm_attach net/kcm/kcmsock.c:1405 [inline] kcm_attach_ioctl net/kcm/kcmsock.c:1490 [inline] kcm_ioctl+0x3d2/0x10b0 net/kcm/kcmsock.c:1696 sock_do_ioctl+0xc9/0x1c0 net/socket.c:1169 sock_ioctl+0x278/0x510 net/socket.c:1286 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __x64_sys_ioctl+0x11f/0x190 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1371 [inline] free_pcp_prepare+0x549/0xd20 mm/page_alloc.c:1421 free_unref_page_prepare mm/page_alloc.c:3343 [inline] free_unref_page+0x19/0x6a0 mm/page_alloc.c:3438 slab_destroy mm/slab.c:1615 [inline] slabs_destroy+0x89/0xc0 mm/slab.c:1635 cache_flusharray mm/slab.c:3397 [inline] ___cache_free+0x34e/0x670 mm/slab.c:3460 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x4f/0x1b0 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x97/0xb0 mm/kasan/common.c:446 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:750 [inline] slab_alloc_node mm/slab.c:3239 [inline] kmem_cache_alloc_node+0x2a0/0x590 mm/slab.c:3593 __alloc_skb+0x151/0x270 net/core/skbuff.c:414 alloc_skb include/linux/skbuff.h:1426 [inline] alloc_skb_with_frags+0x73/0x6f0 net/core/skbuff.c:5992 sock_alloc_send_pskb+0x636/0x7c0 net/core/sock.c:2662 sock_alloc_send_skb include/net/sock.h:1845 [inline] mld_newpack.isra.0+0x1b4/0x760 net/ipv6/mcast.c:1746 add_grhead+0x265/0x350 net/ipv6/mcast.c:1849 add_grec+0xc80/0x1050 net/ipv6/mcast.c:1987 mld_send_cr net/ipv6/mcast.c:2113 [inline] mld_ifc_work+0x3bb/0xa90 net/ipv6/mcast.c:2651 process_one_work+0x865/0x13d0 kernel/workqueue.c:2289 Memory state around the buggy address: ffff88807d2cfd00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88807d2cfd80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc >ffff88807d2cfe00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88807d2cfe80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807d2cff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================