================================================================== BUG: KASAN: use-after-free in memcpy include/linux/string.h:348 [inline] BUG: KASAN: use-after-free in memcpy_dir crypto/scatterwalk.c:28 [inline] BUG: KASAN: use-after-free in scatterwalk_copychunks+0x269/0x6a0 crypto/scatterwalk.c:43 Read of size 4096 at addr ffff888097516000 by task syz-executor.2/12988 CPU: 0 PID: 12988 Comm: syz-executor.2 Not tainted 4.19.76 #0 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:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report mm/kasan/report.c:412 [inline] kasan_report.cold+0x8c/0x2ba mm/kasan/report.c:396 check_memory_region_inline mm/kasan/kasan.c:260 [inline] check_memory_region+0x123/0x190 mm/kasan/kasan.c:267 memcpy+0x24/0x50 mm/kasan/kasan.c:302 memcpy include/linux/string.h:348 [inline] memcpy_dir crypto/scatterwalk.c:28 [inline] scatterwalk_copychunks+0x269/0x6a0 crypto/scatterwalk.c:43 scatterwalk_map_and_copy crypto/scatterwalk.c:72 [inline] scatterwalk_map_and_copy+0x14d/0x1d0 crypto/scatterwalk.c:60 gcmaes_encrypt.constprop.0+0x762/0xd90 arch/x86/crypto/aesni-intel_glue.c:956 generic_gcmaes_encrypt+0x108/0x160 arch/x86/crypto/aesni-intel_glue.c:1297 crypto_aead_encrypt include/crypto/aead.h:335 [inline] gcmaes_wrapper_encrypt+0x15f/0x200 arch/x86/crypto/aesni-intel_glue.c:1130 crypto_aead_encrypt include/crypto/aead.h:335 [inline] tls_do_encryption net/tls/tls_sw.c:193 [inline] tls_push_record+0x9c0/0x13a0 net/tls/tls_sw.c:228 tls_sw_sendpage+0x538/0xd50 net/tls/tls_sw.c:585 inet_sendpage+0x168/0x630 net/ipv4/af_inet.c:815 kernel_sendpage+0x92/0xf0 net/socket.c:3377 sock_sendpage+0x8b/0xc0 net/socket.c:847 pipe_to_sendpage+0x296/0x360 fs/splice.c:452 splice_from_pipe_feed fs/splice.c:503 [inline] __splice_from_pipe+0x391/0x7d0 fs/splice.c:627 splice_from_pipe+0x108/0x170 fs/splice.c:662 generic_splice_sendpage+0x3c/0x50 fs/splice.c:833 do_splice_from fs/splice.c:852 [inline] do_splice+0x642/0x12c0 fs/splice.c:1148 __do_sys_splice fs/splice.c:1415 [inline] __se_sys_splice fs/splice.c:1395 [inline] __x64_sys_splice+0x2c6/0x330 fs/splice.c:1395 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x459a29 Code: fd b7 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 cb b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f4eca047c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000113 RAX: ffffffffffffffda RBX: 00007f4eca047c90 RCX: 0000000000459a29 RDX: 0000000000000006 RSI: 0000000000000000 RDI: 0000000000000005 RBP: 000000000075bf20 R08: 000000011d100000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f4eca0486d4 R13: 00000000004c9478 R14: 00000000004dfdd8 R15: 0000000000000007 Allocated by task 7578: save_stack+0x45/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc mm/kasan/kasan.c:553 [inline] kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:531 kasan_slab_alloc+0xf/0x20 mm/kasan/kasan.c:490 kmem_cache_alloc+0x12e/0x700 mm/slab.c:3559 vm_area_dup+0x21/0x170 kernel/fork.c:323 dup_mmap kernel/fork.c:484 [inline] dup_mm kernel/fork.c:1283 [inline] copy_mm kernel/fork.c:1339 [inline] copy_process.part.0+0x3407/0x7a30 kernel/fork.c:1892 copy_process kernel/fork.c:1689 [inline] _do_fork+0x257/0xfd0 kernel/fork.c:2202 __do_sys_clone kernel/fork.c:2309 [inline] __se_sys_clone kernel/fork.c:2303 [inline] __x64_sys_clone+0xbf/0x150 kernel/fork.c:2303 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 12515: save_stack+0x45/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3503 [inline] kmem_cache_free+0x86/0x260 mm/slab.c:3765 vm_area_free+0x1d/0x30 kernel/fork.c:334 remove_vma+0x13f/0x180 mm/mmap.c:186 exit_mmap+0x369/0x530 mm/mmap.c:3108 __mmput kernel/fork.c:1010 [inline] mmput+0x15f/0x4c0 kernel/fork.c:1031 exec_mmap fs/exec.c:1043 [inline] flush_old_exec+0x8d9/0x1c20 fs/exec.c:1276 load_elf_binary+0x9c0/0x5350 fs/binfmt_elf.c:869 search_binary_handler fs/exec.c:1653 [inline] search_binary_handler+0x179/0x570 fs/exec.c:1631 exec_binprm fs/exec.c:1695 [inline] __do_execve_file.isra.0+0x1227/0x2150 fs/exec.c:1819 do_execveat_common fs/exec.c:1866 [inline] do_execve fs/exec.c:1883 [inline] __do_sys_execve fs/exec.c:1964 [inline] __se_sys_execve fs/exec.c:1959 [inline] __x64_sys_execve+0x8f/0xc0 fs/exec.c:1959 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff888097516000 which belongs to the cache vm_area_struct of size 200 The buggy address is located 0 bytes inside of 200-byte region [ffff888097516000, ffff8880975160c8) The buggy address belongs to the page: page:ffffea00025d4580 count:1 mapcount:0 mapping:ffff88812c26d380 index:0x0 flags: 0x1fffc0000000100(slab) raw: 01fffc0000000100 ffffea00024d2088 ffffea0002651788 ffff88812c26d380 raw: 0000000000000000 ffff888097516000 000000010000000f 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888097515f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888097515f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888097516000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888097516080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc ffff888097516100: fc fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================