================================================================== BUG: KASAN: use-after-free in poly1305_update_arch+0x259/0x7d0 arch/x86/crypto/poly1305_glue.c:198 Read of size 8 at addr ffff88806e001850 by task syz.3.57/5557 CPU: 1 PID: 5557 Comm: syz.3.57 Not tainted 6.10.0-syzkaller-00017-g5e0497553643 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 kasan_check_range+0x282/0x290 mm/kasan/generic.c:189 __asan_memcpy+0x29/0x70 mm/kasan/shadow.c:105 poly1305_update_arch+0x259/0x7d0 arch/x86/crypto/poly1305_glue.c:198 crypto_poly1305_update+0x28/0x40 arch/x86/crypto/poly1305_glue.c:230 bch2_checksum+0x5e9/0x770 fs/bcachefs/checksum.c:229 bch2_btree_node_read_done+0x13de/0x6750 fs/bcachefs/btree_io.c:1115 btree_node_read_work+0x68b/0x1260 fs/bcachefs/btree_io.c:1345 bch2_btree_node_read+0x2433/0x2a10 __bch2_btree_root_read fs/bcachefs/btree_io.c:1769 [inline] bch2_btree_root_read+0x61e/0x970 fs/bcachefs/btree_io.c:1793 read_btree_roots+0x22d/0x7c0 fs/bcachefs/recovery.c:481 bch2_fs_recovery+0x235c/0x3730 fs/bcachefs/recovery.c:809 bch2_fs_start+0x356/0x5b0 fs/bcachefs/super.c:1038 bch2_fs_open+0xa8d/0xdf0 fs/bcachefs/super.c:2135 bch2_mount+0x6b0/0x13c0 fs/bcachefs/fs.c:1932 legacy_get_tree+0xee/0x190 fs/fs_context.c:662 vfs_get_tree+0x90/0x2a0 fs/super.c:1789 do_new_mount+0x2be/0xb40 fs/namespace.c:3352 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3875 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f098e9772da Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 7e 1a 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f098f72ee78 EFLAGS: 00000206 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f098f72ef00 RCX: 00007f098e9772da RDX: 0000000020011a00 RSI: 0000000020011a40 RDI: 00007f098f72eec0 RBP: 0000000020011a00 R08: 00007f098f72ef00 R09: 0000000001200014 R10: 0000000001200014 R11: 0000000000000206 R12: 0000000020011a40 R13: 00007f098f72eec0 R14: 00000000000119f6 R15: 00000000200014c0 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x80 pfn:0x6e001 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea0001832e08 ffffea0001b80008 0000000000000000 raw: 0000000000000080 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Unmovable, gfp_mask 0x152c40(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 5097, tgid 5097 (udevd), ts 81189141016, free_ts 82912556112 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1473 prep_new_page mm/page_alloc.c:1481 [inline] get_page_from_freelist+0x2e4c/0x2f10 mm/page_alloc.c:3425 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4683 alloc_pages_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2265 alloc_pages_noprof mm/mempolicy.c:2336 [inline] folio_alloc_noprof+0x128/0x180 mm/mempolicy.c:2343 filemap_alloc_folio_noprof+0xdf/0x500 mm/filemap.c:1008 page_cache_ra_unbounded+0x1f4/0x7f0 mm/readahead.c:248 do_page_cache_ra mm/readahead.c:303 [inline] force_page_cache_ra+0x2a7/0x310 mm/readahead.c:334 page_cache_sync_readahead include/linux/pagemap.h:1313 [inline] filemap_get_pages+0x49d/0x2090 mm/filemap.c:2529 filemap_read+0x457/0xfa0 mm/filemap.c:2625 blkdev_read_iter+0x2df/0x440 block/fops.c:749 new_sync_read fs/read_write.c:395 [inline] vfs_read+0x9bd/0xbc0 fs/read_write.c:476 ksys_read+0x1a0/0x2c0 fs/read_write.c:619 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 5076 tgid 5076 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1093 [inline] free_unref_folios+0xf12/0x19c0 mm/page_alloc.c:2637 folios_put_refs+0x93a/0xa60 mm/swap.c:1024 folio_batch_release include/linux/pagevec.h:101 [inline] truncate_inode_pages_range+0x47b/0xfc0 mm/truncate.c:362 kill_bdev block/bdev.c:90 [inline] blkdev_flush_mapping+0x108/0x250 block/bdev.c:664 blkdev_put_whole block/bdev.c:671 [inline] bdev_release+0x466/0x700 block/bdev.c:1096 blkdev_release+0x15/0x20 block/fops.c:623 __fput+0x24a/0x8a0 fs/file_table.c:422 task_work_run+0x24f/0x310 kernel/task_work.c:180 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop kernel/entry/common.c:114 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x168/0x360 kernel/entry/common.c:218 do_syscall_64+0x100/0x230 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88806e001700: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88806e001780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88806e001800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88806e001880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88806e001900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================