================================================================== BUG: KASAN: use-after-free in __crypto_xor+0x376/0x410 crypto/algapi.c:1001 Read of size 8 at addr ffff88804c8844d6 by task syz-executor.5/26083 CPU: 1 PID: 26083 Comm: syz-executor.5 Not tainted 5.14.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+0xcd/0x134 lib/dump_stack.c:105 print_address_description.constprop.0.cold+0x6c/0x2d6 mm/kasan/report.c:233 __kasan_report mm/kasan/report.c:419 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:436 __crypto_xor+0x376/0x410 crypto/algapi.c:1001 crypto_xor include/crypto/algapi.h:160 [inline] crypto_ctr_crypt_segment crypto/ctr.c:60 [inline] crypto_ctr_crypt+0x256/0x550 crypto/ctr.c:114 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_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 tls_do_encryption net/tls/tls_sw.c:529 [inline] tls_push_record+0x13d7/0x31c0 net/tls/tls_sw.c:762 bpf_exec_tx_verdict+0xd82/0x11a0 net/tls/tls_sw.c:802 tls_sw_do_sendpage+0xa20/0xf80 net/tls/tls_sw.c:1214 tls_sw_sendpage+0x9d/0xe0 net/tls/tls_sw.c:1278 inet_sendpage+0xd0/0x140 net/ipv4/af_inet.c:835 kernel_sendpage.part.0+0x1a0/0x340 net/socket.c:3673 kernel_sendpage net/socket.c:3670 [inline] sock_sendpage+0xe5/0x140 net/socket.c:1002 pipe_to_sendpage+0x2ad/0x380 fs/splice.c:364 splice_from_pipe_feed fs/splice.c:418 [inline] __splice_from_pipe+0x43e/0x8a0 fs/splice.c:562 splice_from_pipe fs/splice.c:597 [inline] generic_splice_sendpage+0xd4/0x140 fs/splice.c:746 do_splice_from fs/splice.c:767 [inline] direct_splice_actor+0x110/0x180 fs/splice.c:936 splice_direct_to_actor+0x34b/0x8c0 fs/splice.c:891 do_splice_direct+0x1b3/0x280 fs/splice.c:979 do_sendfile+0x9f0/0x1120 fs/read_write.c:1260 __do_sys_sendfile64 fs/read_write.c:1325 [inline] __se_sys_sendfile64 fs/read_write.c:1311 [inline] __x64_sys_sendfile64+0x1cc/0x210 fs/read_write.c:1311 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:0x4665e9 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:00007fb447e17188 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 000000000056c038 RCX: 00000000004665e9 RDX: 0000000000000000 RSI: 0000000000000006 RDI: 0000000000000008 RBP: 00000000004bfcc4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000800100020001 R11: 0000000000000246 R12: 000000000056c038 R13: 00007fff9691d3ff R14: 00007fb447e17300 R15: 0000000000022000 The buggy address belongs to the page: page:ffffea0001322100 refcount:0 mapcount:0 mapping:0000000000000000 index:0x100 pfn:0x4c884 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 dead000000000100 dead000000000122 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 0, migratetype Movable, gfp_mask 0x1100c0a(GFP_NOIO|__GFP_HIGHMEM|__GFP_HARDWALL|__GFP_MOVABLE|0x1000000), pid 27, ts 782308811089, free_ts 784039420196 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_vma+0xd9/0x710 mm/mempolicy.c:2208 shmem_alloc_page+0x11f/0x1f0 mm/shmem.c:1563 shmem_alloc_and_acct_page+0x161/0x8c0 mm/shmem.c:1588 shmem_getpage_gfp+0x6b2/0x2780 mm/shmem.c:1917 shmem_getpage mm/shmem.c:155 [inline] shmem_file_read_iter+0x578/0xd30 mm/shmem.c:2571 call_read_iter include/linux/fs.h:2108 [inline] do_iter_readv_writev+0x56a/0x740 fs/read_write.c:738 do_iter_read+0x285/0x6e0 fs/read_write.c:801 vfs_iter_read+0x70/0xa0 fs/read_write.c:843 lo_read_simple drivers/block/loop.c:404 [inline] do_req_filebacked drivers/block/loop.c:675 [inline] loop_handle_cmd drivers/block/loop.c:2204 [inline] loop_process_work+0x108b/0x24e0 drivers/block/loop.c:2244 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 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] shmem_undo_range+0x6fb/0x1650 mm/shmem.c:931 shmem_truncate_range mm/shmem.c:1030 [inline] shmem_evict_inode+0x3a4/0xbd0 mm/shmem.c:1132 evict+0x2ed/0x6b0 fs/inode.c:584 iput_final fs/inode.c:1660 [inline] iput.part.0+0x539/0x850 fs/inode.c:1686 iput+0x58/0x70 fs/inode.c:1676 dentry_unlink_inode+0x2b1/0x3d0 fs/dcache.c:376 __dentry_kill+0x3c0/0x640 fs/dcache.c:582 dentry_kill fs/dcache.c:708 [inline] dput+0x73a/0xbc0 fs/dcache.c:888 __fput+0x3ae/0x920 fs/file_table.c:293 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:175 [inline] exit_to_user_mode_prepare+0x27e/0x290 kernel/entry/common.c:209 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:302 Memory state around the buggy address: ffff88804c884380: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88804c884400: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88804c884480: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88804c884500: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88804c884580: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================