================================================================== BUG: KASAN: use-after-free in memcpy include/linux/fortify-string.h:191 [inline] BUG: KASAN: use-after-free in memcpy_dir crypto/scatterwalk.c:23 [inline] BUG: KASAN: use-after-free in scatterwalk_copychunks+0x271/0x6a0 crypto/scatterwalk.c:38 Read of size 4 at addr ffff888057f76000 by task kworker/u4:8/21073 CPU: 0 PID: 21073 Comm: kworker/u4:8 Not tainted 5.14.0-rc5-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: pencrypt_parallel padata_parallel_worker Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:105 print_address_description.constprop.0.cold+0x6c/0x309 mm/kasan/report.c:233 __kasan_report mm/kasan/report.c:419 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:436 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189 memcpy+0x20/0x60 mm/kasan/shadow.c:65 memcpy include/linux/fortify-string.h:191 [inline] memcpy_dir crypto/scatterwalk.c:23 [inline] scatterwalk_copychunks+0x271/0x6a0 crypto/scatterwalk.c:38 skcipher_next_slow crypto/skcipher.c:278 [inline] skcipher_walk_next+0x7af/0x1680 crypto/skcipher.c:363 skcipher_walk_done+0x7a3/0xf00 crypto/skcipher.c:159 crypto_ctr_crypt+0x281/0x550 crypto/ctr.c:116 crypto_skcipher_encrypt+0xaa/0xf0 crypto/skcipher.c:630 crypto_gcm_encrypt+0x38f/0x4b0 crypto/gcm.c:461 crypto_aead_encrypt+0xaa/0xf0 crypto/aead.c:94 pcrypt_aead_enc+0x13/0x70 crypto/pcrypt.c:82 padata_do_parallel+0x754/0x8b0 kernel/padata.c:230 pcrypt_aead_encrypt+0x39f/0x4d0 crypto/pcrypt.c:115 crypto_aead_encrypt+0xaa/0xf0 crypto/aead.c:94 pcrypt_aead_enc+0x13/0x70 crypto/pcrypt.c:82 padata_parallel_worker+0x60/0xb0 kernel/padata.c:157 process_one_work+0x98d/0x1630 kernel/workqueue.c:2276 worker_thread+0x658/0x11f0 kernel/workqueue.c:2422 kthread+0x3e5/0x4d0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 The buggy address belongs to the page: page:ffffea00015fdd80 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x57f76 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea00015fc888 ffffea00015fd288 0000000000000000 raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Movable, gfp_mask 0x1112c4a(GFP_NOFS|__GFP_HIGHMEM|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL|__GFP_MOVABLE|0x1000000), pid 21063, ts 482267125061, free_ts 482629519804 prep_new_page mm/page_alloc.c:2436 [inline] get_page_from_freelist+0xa72/0x2f80 mm/page_alloc.c:4169 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5391 alloc_pages+0x18c/0x2a0 mm/mempolicy.c:2244 __page_cache_alloc mm/filemap.c:1005 [inline] __page_cache_alloc+0x303/0x3a0 mm/filemap.c:990 page_cache_ra_unbounded+0x348/0x930 mm/readahead.c:215 do_page_cache_ra mm/readahead.c:267 [inline] ondemand_readahead+0x61e/0x11a0 mm/readahead.c:550 page_cache_async_ra mm/readahead.c:607 [inline] page_cache_async_ra+0x2e1/0x3f0 mm/readahead.c:582 page_cache_async_readahead include/linux/pagemap.h:907 [inline] filemap_readahead mm/filemap.c:2442 [inline] filemap_get_pages+0x61a/0x1940 mm/filemap.c:2483 filemap_read+0x2ca/0xe40 mm/filemap.c:2550 generic_file_read_iter+0x397/0x4f0 mm/filemap.c:2701 ext4_file_read_iter+0x1d4/0x5d0 fs/ext4/file.c:130 call_read_iter include/linux/fs.h:2108 [inline] generic_file_splice_read+0x450/0x6c0 fs/splice.c:311 do_splice_to+0x1bf/0x250 fs/splice.c:796 splice_direct_to_actor+0x2c2/0x8c0 fs/splice.c:870 do_splice_direct+0x1b3/0x280 fs/splice.c:979 do_sendfile+0x9f0/0x1120 fs/read_write.c:1260 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1346 [inline] free_pcp_prepare+0x2c5/0x780 mm/page_alloc.c:1397 free_unref_page_prepare mm/page_alloc.c:3332 [inline] free_unref_page_list+0x1a1/0x1050 mm/page_alloc.c:3448 release_pages+0x824/0x20b0 mm/swap.c:972 __pagevec_release+0x77/0x100 mm/swap.c:992 pagevec_release include/linux/pagevec.h:81 [inline] truncate_inode_pages_range+0x320/0x1030 mm/truncate.c:329 truncate_inode_pages mm/truncate.c:424 [inline] truncate_pagecache+0x63/0x90 mm/truncate.c:736 ext4_setattr+0x11dc/0x2000 fs/ext4/inode.c:5498 notify_change+0xb28/0x10f0 fs/attr.c:398 do_truncate+0x13c/0x200 fs/open.c:64 handle_truncate fs/namei.c:3030 [inline] do_open fs/namei.c:3378 [inline] path_openat+0x20f4/0x27f0 fs/namei.c:3507 do_filp_open+0x1aa/0x400 fs/namei.c:3534 do_sys_openat2+0x16d/0x420 fs/open.c:1204 do_sys_open fs/open.c:1220 [inline] __do_sys_creat fs/open.c:1294 [inline] __se_sys_creat fs/open.c:1288 [inline] __x64_sys_creat+0xc9/0x120 fs/open.c:1288 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 Memory state around the buggy address: ffff888057f75f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888057f75f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888057f76000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888057f76080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888057f76100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================