bisecting fixing commit since 68d7a45eec101bc1550294c0e675a490c047b2e5 building syzkaller on b0e8efcb4b0aac61f4647a76bbe54a5d38a370ba testing commit 68d7a45eec101bc1550294c0e675a490c047b2e5 with gcc (GCC) 8.1.0 kernel signature: 2227b4e81fe36c8d1df0b46559d36eddb2c38c53 run #0: crashed: KASAN: slab-out-of-bounds Read in scatterwalk_copychunks run #1: crashed: KASAN: slab-out-of-bounds Read in scatterwalk_copychunks run #2: crashed: KASAN: slab-out-of-bounds Read in scatterwalk_copychunks run #3: crashed: KASAN: use-after-free Read in scatterwalk_copychunks run #4: crashed: general protection fault in scatterwalk_copychunks run #5: crashed: KASAN: use-after-free Read in scatterwalk_copychunks run #6: crashed: KASAN: slab-out-of-bounds Read in scatterwalk_copychunks run #7: crashed: KASAN: slab-out-of-bounds Read in scatterwalk_copychunks run #8: crashed: KASAN: slab-out-of-bounds Read in scatterwalk_copychunks run #9: crashed: general protection fault in corrupted testing current HEAD 84f5ad468100f86d70096799e4ee716a17c2962f testing commit 84f5ad468100f86d70096799e4ee716a17c2962f with gcc (GCC) 8.1.0 kernel signature: fc4c34273cd2361f29656c80e31c88aee09110c7 run #0: crashed: KASAN: slab-out-of-bounds Read in scatterwalk_copychunks run #1: crashed: KASAN: slab-out-of-bounds Read in scatterwalk_copychunks run #2: crashed: KASAN: use-after-free Read in scatterwalk_copychunks run #3: crashed: KASAN: use-after-free Read in scatterwalk_copychunks run #4: crashed: KASAN: slab-out-of-bounds Read in scatterwalk_copychunks run #5: crashed: KASAN: use-after-free Read in scatterwalk_copychunks run #6: crashed: KASAN: use-after-free Read in scatterwalk_copychunks run #7: crashed: KASAN: slab-out-of-bounds Read in scatterwalk_copychunks run #8: crashed: KASAN: slab-out-of-bounds Read in scatterwalk_copychunks run #9: crashed: KASAN: slab-out-of-bounds Read in scatterwalk_copychunks revisions tested: 2, total time: 32m23.087442608s (build: 16m30.840975495s, test: 14m55.472387609s) the crash still happens on HEAD commit msg: Linux 4.14.162 crash: KASAN: slab-out-of-bounds Read in scatterwalk_copychunks ================================================================== SYSC_futex kernel/futex.c:3963 [inline] SyS_futex+0xf1/0x250 kernel/futex.c:3931 BUG: KASAN: slab-out-of-bounds in memcpy include/linux/string.h:347 [inline] BUG: KASAN: slab-out-of-bounds in memcpy_dir crypto/scatterwalk.c:28 [inline] BUG: KASAN: slab-out-of-bounds in scatterwalk_copychunks+0x207/0x690 crypto/scatterwalk.c:43 Read of size 4096 at addr ffff88809ed2c000 by task syz-executor.0/9745 mm_release+0x229/0x2a0 kernel/fork.c:1155 exit_mm_release+0x1d/0x30 kernel/fork.c:1172 exit_mm kernel/exit.c:500 [inline] do_exit+0x34a/0x2e20 kernel/exit.c:841 do_group_exit+0xf4/0x2f0 kernel/exit.c:951 get_signal+0x2fe/0x1b40 kernel/signal.c:2413 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+0x418/0x5b0 arch/x86/entry/common.c:297 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x458c29 RSP: 002b:00007f36b599dc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffe0 RBX: 00007f36b599dc90 RCX: 0000000000458c29 RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000003 RBP: 000000000073bfa0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000006785 R11: 0000000000000246 R12: 00007f36b599e6d4 R13: 00000000004c5e10 R14: 00000000004da5c8 R15: 0000000000000005 CPU: 0 PID: 9745 Comm: syz-executor.0 Not tainted 4.14.162-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 FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 check_memory_region_inline mm/kasan/kasan.c:260 [inline] check_memory_region+0x13e/0x1b0 mm/kasan/kasan.c:267 memcpy+0x23/0x50 mm/kasan/kasan.c:302 memcpy include/linux/string.h:347 [inline] memcpy_dir crypto/scatterwalk.c:28 [inline] scatterwalk_copychunks+0x207/0x690 crypto/scatterwalk.c:43 scatterwalk_map_and_copy+0x10d/0x1a0 crypto/scatterwalk.c:72 gcmaes_encrypt.constprop.14+0x1c0/0xae0 arch/x86/crypto/aesni-intel_glue.c:778 generic_gcmaes_encrypt+0xf8/0x13d arch/x86/crypto/aesni-intel_glue.c:1111 crypto_aead_encrypt include/crypto/aead.h:330 [inline] gcmaes_wrapper_encrypt+0xe5/0x140 arch/x86/crypto/aesni-intel_glue.c:945 crypto_aead_encrypt include/crypto/aead.h:330 [inline] tls_do_encryption net/tls/tls_sw.c:234 [inline] tls_push_record+0x8ec/0x14d0 net/tls/tls_sw.c:270 tls_sw_sendpage+0x446/0xc50 net/tls/tls_sw.c:617 inet_sendpage+0x125/0x600 net/ipv4/af_inet.c:779 kernel_sendpage+0x63/0xd0 net/socket.c:3406 sock_sendpage+0x6d/0xd0 net/socket.c:871 pipe_to_sendpage+0x208/0x420 fs/splice.c:451 splice_from_pipe_feed fs/splice.c:502 [inline] __splice_from_pipe+0x2d4/0x730 fs/splice.c:626 splice_from_pipe+0xb5/0x110 fs/splice.c:661 generic_splice_sendpage+0x10/0x20 fs/splice.c:832 do_splice_from fs/splice.c:851 [inline] direct_splice_actor+0x107/0x1c0 fs/splice.c:1018 splice_direct_to_actor+0x27f/0x760 fs/splice.c:973 do_splice_direct+0x144/0x250 fs/splice.c:1061 do_sendfile+0x463/0xd00 fs/read_write.c:1441 SYSC_sendfile64 fs/read_write.c:1502 [inline] SyS_sendfile64+0xf5/0x110 fs/read_write.c:1488 do_syscall_64+0x1c9/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x458c29 RSP: 002b:00007ff44fcf8c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 00007ff44fcf8c90 RCX: 0000000000458c29 RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000003 RBP: 000000000073bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000006785 R11: 0000000000000246 R12: 00007ff44fcf96d4 R13: 00000000004c5e10 R14: 00000000004da5c8 R15: 0000000000000005 CPU: 1 PID: 9741 Comm: syz-executor.1 Not tainted 4.14.162-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Allocated by task 9006: Call Trace: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0xf7/0x13b lib/dump_stack.c:58 save_stack+0x43/0xd0 mm/kasan/kasan.c:447 fail_dump lib/fault-inject.c:51 [inline] should_fail.cold.3+0x105/0x14b lib/fault-inject.c:149 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:551 kmem_cache_alloc_trace+0x152/0x7b0 mm/slab.c:3618 should_failslab+0xba/0xf0 mm/failslab.c:32 kmalloc include/linux/slab.h:488 [inline] pagemap_read+0x21e/0x5b0 fs/proc/task_mmu.c:1518 slab_pre_alloc_hook mm/slab.h:421 [inline] slab_alloc mm/slab.c:3376 [inline] __do_kmalloc mm/slab.c:3718 [inline] __kmalloc+0x70/0x7b0 mm/slab.c:3729 do_loop_readv_writev fs/read_write.c:695 [inline] do_iter_read+0x36c/0x5a0 fs/read_write.c:919 vfs_readv+0xb6/0x110 fs/read_write.c:981 kernel_readv fs/splice.c:361 [inline] default_file_splice_read+0x3fe/0x820 fs/splice.c:416 do_splice_to+0xea/0x130 fs/splice.c:880 splice_direct_to_actor+0x20d/0x760 fs/splice.c:952 kmalloc include/linux/slab.h:493 [inline] gcmaes_encrypt.constprop.14+0x130/0xae0 arch/x86/crypto/aesni-intel_glue.c:774 do_splice_direct+0x144/0x250 fs/splice.c:1061 do_sendfile+0x463/0xd00 fs/read_write.c:1441 generic_gcmaes_encrypt+0xf8/0x13d arch/x86/crypto/aesni-intel_glue.c:1111 SYSC_sendfile64 fs/read_write.c:1502 [inline] SyS_sendfile64+0xf5/0x110 fs/read_write.c:1488 do_syscall_64+0x1c9/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 crypto_aead_encrypt include/crypto/aead.h:330 [inline] gcmaes_wrapper_encrypt+0xe5/0x140 arch/x86/crypto/aesni-intel_glue.c:945 Freed by task 9006: crypto_aead_encrypt include/crypto/aead.h:330 [inline] tls_do_encryption net/tls/tls_sw.c:234 [inline] tls_push_record+0x8ec/0x14d0 net/tls/tls_sw.c:270 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 tls_sw_sendpage+0x446/0xc50 net/tls/tls_sw.c:617 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] kfree+0xcc/0x270 mm/slab.c:3815 inet_sendpage+0x125/0x600 net/ipv4/af_inet.c:779 pagemap_read+0x453/0x5b0 fs/proc/task_mmu.c:1575 do_loop_readv_writev fs/read_write.c:695 [inline] do_iter_read+0x36c/0x5a0 fs/read_write.c:919 vfs_readv+0xb6/0x110 fs/read_write.c:981 kernel_readv fs/splice.c:361 [inline] default_file_splice_read+0x3fe/0x820 fs/splice.c:416 kernel_sendpage+0x63/0xd0 net/socket.c:3406 do_splice_to+0xea/0x130 fs/splice.c:880 sock_sendpage+0x6d/0xd0 net/socket.c:871 splice_direct_to_actor+0x20d/0x760 fs/splice.c:952 pipe_to_sendpage+0x208/0x420 fs/splice.c:451 do_splice_direct+0x144/0x250 fs/splice.c:1061 do_sendfile+0x463/0xd00 fs/read_write.c:1441 SYSC_sendfile64 fs/read_write.c:1502 [inline] SyS_sendfile64+0xf5/0x110 fs/read_write.c:1488 splice_from_pipe_feed fs/splice.c:502 [inline] __splice_from_pipe+0x2d4/0x730 fs/splice.c:626 do_syscall_64+0x1c9/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 The buggy address belongs to the object at ffff88809ed2ca00 which belongs to the cache kmalloc-4096 of size 4096 The buggy address is located 2560 bytes to the left of 4096-byte region [ffff88809ed2ca00, ffff88809ed2da00) splice_from_pipe+0xb5/0x110 fs/splice.c:661 The buggy address belongs to the page: page:ffffea00027b4b00 count:1 mapcount:0 mapping:ffff88809ed2ca00 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000008100(slab|head) generic_splice_sendpage+0x10/0x20 fs/splice.c:832 raw: 01fffc0000008100 ffff88809ed2ca00 0000000000000000 0000000100000001 do_splice_from fs/splice.c:851 [inline] direct_splice_actor+0x107/0x1c0 fs/splice.c:1018 raw: ffffea00028021a0 ffffea00020693a0 ffff8880aa800dc0 0000000000000000 page dumped because: kasan: bad access detected splice_direct_to_actor+0x27f/0x760 fs/splice.c:973 Memory state around the buggy address: ffff88809ed2bf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88809ed2bf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88809ed2c000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88809ed2c080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc do_splice_direct+0x144/0x250 fs/splice.c:1061 ffff88809ed2c100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================