bisecting fixing commit since 7cca308cfdc0725363ac5943dca9dcd49cc1d2d5 building syzkaller on d236a457274375e5273ac4e958722659929c469f testing commit 7cca308cfdc0725363ac5943dca9dcd49cc1d2d5 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: c28335c7d8579da09481a6d11fd7bc4e6130fa6013eb98e99420097f8da4478b run #0: crashed: KASAN: slab-out-of-bounds Read in __crypto_xor run #1: crashed: KASAN: slab-out-of-bounds Read in __crypto_xor run #2: crashed: KASAN: use-after-free Read in __crypto_xor run #3: crashed: KASAN: slab-out-of-bounds Read in __crypto_xor run #4: crashed: KASAN: slab-out-of-bounds Read in __crypto_xor run #5: crashed: KASAN: slab-out-of-bounds Read in __crypto_xor run #6: crashed: KASAN: use-after-free Read in __crypto_xor run #7: crashed: KASAN: slab-out-of-bounds Read in __crypto_xor run #8: crashed: KASAN: use-after-free Read in scatterwalk_copychunks run #9: crashed: KASAN: use-after-free Read in __crypto_xor run #10: crashed: KASAN: slab-out-of-bounds Read in __crypto_xor run #11: crashed: KASAN: use-after-free Read in scatterwalk_copychunks run #12: crashed: KASAN: slab-out-of-bounds Read in __crypto_xor run #13: crashed: KASAN: use-after-free Read in __crypto_xor run #14: crashed: KASAN: use-after-free Read in __crypto_xor run #15: crashed: no output from test machine run #16: crashed: KASAN: use-after-free Read in __crypto_xor run #17: crashed: KASAN: slab-out-of-bounds Read in __crypto_xor run #18: OK run #19: OK testing current HEAD 9e1ff307c779ce1f0f810c7ecce3d95bbae40896 testing commit 9e1ff307c779ce1f0f810c7ecce3d95bbae40896 compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 0af66a0d6be3ccacde8c813183eab36d454f1c0087109a377adba89578e56759 run #0: crashed: KASAN: use-after-free Read in scatterwalk_copychunks run #1: crashed: KASAN: slab-out-of-bounds Read in __crypto_xor run #2: crashed: KASAN: slab-out-of-bounds Read in __crypto_xor run #3: crashed: KASAN: slab-out-of-bounds Read in __crypto_xor run #4: crashed: KASAN: use-after-free Read in __crypto_xor run #5: crashed: KASAN: use-after-free Read in __crypto_xor run #6: crashed: KASAN: use-after-free Write in pcrypt_aead_enc run #7: crashed: KASAN: use-after-free Read in __crypto_xor run #8: crashed: KASAN: use-after-free Read in __crypto_xor run #9: crashed: KASAN: use-after-free Read in __crypto_xor revisions tested: 2, total time: 30m38.142895174s (build: 14m20.43807767s, test: 15m47.661930357s) the crash still happens on HEAD commit msg: Linux 5.15-rc4 crash: KASAN: use-after-free Read in __crypto_xor ================================================================== BUG: KASAN: use-after-free in __crypto_xor+0x296/0x400 crypto/algapi.c:1001 Read of size 8 at addr ffff88805d2a1fc9 by task syz-executor.2/10116 CPU: 0 PID: 10116 Comm: syz-executor.2 Not tainted 5.15.0-rc4-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+0x6c/0x309 mm/kasan/report.c:256 __kasan_report mm/kasan/report.c:442 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:459 __crypto_xor+0x296/0x400 crypto/algapi.c:1001 crypto_xor include/crypto/algapi.h:160 [inline] crypto_ctr_crypt_segment crypto/ctr.c:60 [inline] crypto_ctr_crypt+0x238/0x4e0 crypto/ctr.c:114 crypto_gcm_encrypt+0x360/0x550 crypto/gcm.c:461 pcrypt_aead_enc+0x11/0x60 crypto/pcrypt.c:82 padata_do_parallel+0x5cc/0x720 kernel/padata.c:217 pcrypt_aead_encrypt+0x396/0x4b0 crypto/pcrypt.c:115 pcrypt_aead_enc+0x11/0x60 crypto/pcrypt.c:82 padata_do_parallel+0x5cc/0x720 kernel/padata.c:217 pcrypt_aead_encrypt+0x396/0x4b0 crypto/pcrypt.c:115 tls_do_encryption net/tls/tls_sw.c:529 [inline] tls_push_record+0x11d0/0x31c0 net/tls/tls_sw.c:762 bpf_exec_tx_verdict+0xa86/0xf40 net/tls/tls_sw.c:802 tls_sw_do_sendpage+0x815/0xdf0 net/tls/tls_sw.c:1214 tls_sw_sendpage+0x72/0xb0 net/tls/tls_sw.c:1278 inet_sendpage+0xae/0x120 net/ipv4/af_inet.c:835 kernel_sendpage.part.0+0x11e/0x240 net/socket.c:3504 kernel_sendpage net/socket.c:3501 [inline] sock_sendpage+0xc7/0x1a0 net/socket.c:1003 pipe_to_sendpage+0x245/0x410 fs/splice.c:364 splice_from_pipe_feed fs/splice.c:418 [inline] __splice_from_pipe+0x362/0x810 fs/splice.c:562 splice_from_pipe fs/splice.c:597 [inline] generic_splice_sendpage+0xba/0x120 fs/splice.c:746 do_splice_from fs/splice.c:767 [inline] do_splice+0x9ef/0x1b30 fs/splice.c:1079 __do_splice+0xf4/0x1b0 fs/splice.c:1144 __do_sys_splice fs/splice.c:1350 [inline] __se_sys_splice fs/splice.c:1332 [inline] __x64_sys_splice+0x14a/0x200 fs/splice.c:1332 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+0x44/0xae RIP: 0033:0x4665f9 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f7c22042188 EFLAGS: 00000246 ORIG_RAX: 0000000000000113 RAX: ffffffffffffffda RBX: 000000000056bf80 RCX: 00000000004665f9 RDX: 0000000000000005 RSI: 0000000000000000 RDI: 0000000000000004 RBP: 00000000004bfcc4 R08: 0000000100000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf80 R13: 0000000000a9fb1f R14: 00007f7c22042300 R15: 0000000000022000 The buggy address belongs to the page: page:ffffea000174a840 refcount:0 mapcount:0 mapping:0000000000000000 index:0x100 pfn:0x5d2a1 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 0000000000000000 ffffffff01740301 0000000000000000 raw: 0000000000000100 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 2968, ts 92527041312, free_ts 121467136417 prep_new_page mm/page_alloc.c:2424 [inline] get_page_from_freelist+0xa6f/0x2f50 mm/page_alloc.c:4153 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5375 alloc_slab_page mm/slub.c:1763 [inline] allocate_slab mm/slub.c:1900 [inline] new_slab+0x319/0x490 mm/slub.c:1963 ___slab_alloc+0x923/0xfe0 mm/slub.c:2994 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3081 slab_alloc_node mm/slub.c:3172 [inline] slab_alloc mm/slub.c:3214 [inline] kmem_cache_alloc+0x365/0x390 mm/slub.c:3219 getname_flags.part.0+0x4a/0x440 fs/namei.c:138 do_sys_openat2+0xd2/0x400 fs/open.c:1194 do_sys_open fs/open.c:1216 [inline] __do_sys_open fs/open.c:1224 [inline] __se_sys_open fs/open.c:1220 [inline] __x64_sys_open+0xfd/0x1a0 fs/open.c:1220 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+0x44/0xae page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1338 [inline] free_pcp_prepare+0x2c5/0x780 mm/page_alloc.c:1389 free_unref_page_prepare mm/page_alloc.c:3315 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3394 __unfreeze_partials+0x340/0x360 mm/slub.c:2495 qlink_free mm/kasan/quarantine.c:146 [inline] qlist_free_all+0x5a/0xc0 mm/kasan/quarantine.c:165 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:272 __kasan_slab_alloc+0x95/0xb0 mm/kasan/common.c:444 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook mm/slab.h:519 [inline] slab_alloc_node mm/slub.c:3206 [inline] slab_alloc mm/slub.c:3214 [inline] kmem_cache_alloc+0x209/0x390 mm/slub.c:3219 kmem_cache_zalloc include/linux/slab.h:711 [inline] taskstats_tgid_alloc kernel/taskstats.c:561 [inline] taskstats_exit+0x527/0xa70 kernel/taskstats.c:600 do_exit+0x520/0x24b0 kernel/exit.c:810 do_group_exit+0xe7/0x290 kernel/exit.c:922 get_signal+0x3b2/0x1c80 kernel/signal.c:2868 arch_do_signal_or_restart+0x2a9/0x1c40 arch/x86/kernel/signal.c:865 handle_signal_work kernel/entry/common.c:148 [inline] exit_to_user_mode_loop kernel/entry/common.c:172 [inline] exit_to_user_mode_prepare+0x17d/0x290 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:300 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae Memory state around the buggy address: ffff88805d2a1e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88805d2a1f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88805d2a1f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88805d2a2000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88805d2a2080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================