================================================================== BUG: KASAN: use-after-free in __crypto_xor+0x376/0x410 crypto/algapi.c:1001 Read of size 8 at addr ffff88804d285e49 by task syz-executor.1/13062 CPU: 0 PID: 13062 Comm: syz-executor.1 Not tainted 5.14.0-rc5-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:00007f5a4ef80188 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: 00007ffe3d05e18f R14: 00007f5a4ef80300 R15: 0000000000022000 The buggy address belongs to the page: page:ffffea000134a140 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x4d285 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea000134a188 ffffea000134a108 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 0x1101cca(GFP_HIGHUSER_MOVABLE|__GFP_WRITE), pid 11008, ts 1414966385277, free_ts 1416140006427 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 pagecache_get_page+0x357/0x18d0 mm/filemap.c:1885 grab_cache_page_write_begin+0x64/0x90 mm/filemap.c:3610 ext4_da_write_begin+0x354/0x11c0 fs/ext4/inode.c:2984 generic_perform_write+0x202/0x500 mm/filemap.c:3656 ext4_buffered_write_iter+0x244/0x4d0 fs/ext4/file.c:269 ext4_file_write_iter+0x423/0x14e0 fs/ext4/file.c:680 call_write_iter include/linux/fs.h:2114 [inline] new_sync_write+0x426/0x650 fs/read_write.c:518 vfs_write+0x75a/0xa40 fs/read_write.c:605 ksys_write+0x12d/0x250 fs/read_write.c:658 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: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+0x737/0x1030 mm/truncate.c:401 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: ffff88804d285d00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88804d285d80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88804d285e00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88804d285e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88804d285f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================