bcachefs (loop4): mounting version 1.7: mi_btree_bitmap opts=metadata_checksum=none,data_checksum=none,nojournal_transaction_names bcachefs (loop4): recovering from clean shutdown, journal seq 10 ================================================================== BUG: KASAN: slab-out-of-bounds in poly1305_update_arch+0x259/0x7d0 arch/x86/crypto/poly1305_glue.c:198 Read of size 8 at addr ffff888057061790 by task syz-executor.4/6680 CPU: 1 PID: 6680 Comm: syz-executor.4 Not tainted 6.9.0-rc6-syzkaller-00234-g7367539ad4b0 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/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+0x5a9/0x730 fs/bcachefs/checksum.c:228 bch2_btree_node_read_done+0x109a/0x5a40 fs/bcachefs/btree_io.c:1096 btree_node_read_work+0x665/0x1300 fs/bcachefs/btree_io.c:1324 bch2_btree_node_read+0x2b64/0x32c0 __bch2_btree_root_read fs/bcachefs/btree_io.c:1748 [inline] bch2_btree_root_read+0x61e/0x970 fs/bcachefs/btree_io.c:1772 read_btree_roots+0x22d/0x7b0 fs/bcachefs/recovery.c:457 bch2_fs_recovery+0x431c/0x6390 fs/bcachefs/recovery.c:785 bch2_fs_start+0x356/0x5b0 fs/bcachefs/super.c:1043 bch2_fs_open+0xa8d/0xdf0 fs/bcachefs/super.c:2102 bch2_mount+0x71d/0x1320 fs/bcachefs/fs.c:1903 legacy_get_tree+0xf0/0x190 fs/fs_context.c:662 vfs_get_tree+0x92/0x2a0 fs/super.c:1779 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+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fe55287f3aa Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 09 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fe553654ef8 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007fe553654f80 RCX: 00007fe55287f3aa RDX: 0000000020011a00 RSI: 0000000020011a40 RDI: 00007fe553654f40 RBP: 0000000020011a00 R08: 00007fe553654f80 R09: 0000000001200014 R10: 0000000001200014 R11: 0000000000000202 R12: 0000000020011a40 R13: 00007fe553654f40 R14: 00000000000119f9 R15: 0000000020000100 Allocated by task 5363: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:370 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:387 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slub.c:3966 [inline] __kmalloc_node_track_caller+0x24e/0x4e0 mm/slub.c:3986 kmemdup+0x2a/0x60 mm/util.c:131 __devinet_sysctl_register+0xb0/0x2b0 net/ipv4/devinet.c:2577 devinet_sysctl_register+0x17e/0x1f0 net/ipv4/devinet.c:2629 inetdev_init+0x296/0x4d0 net/ipv4/devinet.c:286 inetdev_event+0x338/0x15c0 net/ipv4/devinet.c:1560 notifier_call_chain+0x1a1/0x3e0 kernel/notifier.c:93 call_netdevice_notifiers_extack net/core/dev.c:1988 [inline] call_netdevice_notifiers net/core/dev.c:2002 [inline] register_netdevice+0x15b2/0x1a20 net/core/dev.c:10316 wg_newlink+0x355/0x640 drivers/net/wireguard/device.c:367 rtnl_newlink_create net/core/rtnetlink.c:3494 [inline] __rtnl_newlink net/core/rtnetlink.c:3714 [inline] rtnl_newlink+0x1591/0x20a0 net/core/rtnetlink.c:3727 rtnetlink_rcv_msg+0x89d/0x10d0 net/core/rtnetlink.c:6595 netlink_rcv_skb+0x1e5/0x430 net/netlink/af_netlink.c:2559 netlink_unicast_kernel net/netlink/af_netlink.c:1335 [inline] netlink_unicast+0x7ec/0x980 net/netlink/af_netlink.c:1361 netlink_sendmsg+0x8e1/0xcb0 net/netlink/af_netlink.c:1905 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0x223/0x270 net/socket.c:745 __sys_sendto+0x3a4/0x4f0 net/socket.c:2191 __do_sys_sendto net/socket.c:2203 [inline] __se_sys_sendto net/socket.c:2199 [inline] __x64_sys_sendto+0xde/0x100 net/socket.c:2199 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888057060000 which belongs to the cache kmalloc-cg-4k of size 4096 The buggy address is located 3848 bytes to the right of allocated 2184-byte region [ffff888057060000, ffff888057060888) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x57060 head: order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000840 ffff88801504f500 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000 head: 00fff00000000840 ffff88801504f500 dead000000000100 dead000000000122 head: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000 head: 00fff00000000003 ffffea00015c1801 dead000000000122 00000000ffffffff head: 0000000800000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4541, tgid -835048083 (udevd), ts 4541, free_ts 42098124087 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1ea/0x210 mm/page_alloc.c:1534 prep_new_page mm/page_alloc.c:1541 [inline] get_page_from_freelist+0x3410/0x35b0 mm/page_alloc.c:3317 __alloc_pages+0x256/0x6c0 mm/page_alloc.c:4575 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page+0x5f/0x160 mm/slub.c:2175 allocate_slab mm/slub.c:2338 [inline] new_slab+0x84/0x2f0 mm/slub.c:2391 ___slab_alloc+0xc73/0x1260 mm/slub.c:3525 __slab_alloc mm/slub.c:3610 [inline] __slab_alloc_node mm/slub.c:3663 [inline] slab_alloc_node mm/slub.c:3835 [inline] __do_kmalloc_node mm/slub.c:3965 [inline] __kmalloc_node+0x2db/0x4e0 mm/slub.c:3973 kmalloc_node include/linux/slab.h:648 [inline] kvmalloc_node+0x72/0x190 mm/util.c:634 kvmalloc include/linux/slab.h:766 [inline] seq_buf_alloc fs/seq_file.c:38 [inline] seq_read_iter+0x202/0xd60 fs/seq_file.c:210 call_read_iter include/linux/fs.h:2104 [inline] new_sync_read fs/read_write.c:395 [inline] vfs_read+0x97d/0xb70 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+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 4549 tgid 4549 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1141 [inline] free_unref_page_prepare+0x986/0xab0 mm/page_alloc.c:2347 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2487 discard_slab mm/slub.c:2437 [inline] __put_partials+0xeb/0x130 mm/slub.c:2906 put_cpu_partial+0x17c/0x250 mm/slub.c:2981 __slab_free+0x2ea/0x3d0 mm/slub.c:4151 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x5e/0xc0 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x14f/0x170 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x23/0x80 mm/kasan/common.c:322 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3798 [inline] slab_alloc_node mm/slub.c:3845 [inline] __do_kmalloc_node mm/slub.c:3965 [inline] __kmalloc+0x1e2/0x4a0 mm/slub.c:3979 kmalloc include/linux/slab.h:632 [inline] kzalloc include/linux/slab.h:749 [inline] tomoyo_encode2 security/tomoyo/realpath.c:45 [inline] tomoyo_encode+0x26f/0x540 security/tomoyo/realpath.c:80 tomoyo_path_perm+0x3ca/0x740 security/tomoyo/file.c:831 tomoyo_path_symlink+0xde/0x120 security/tomoyo/tomoyo.c:212 security_path_symlink+0xe5/0x140 security/security.c:1876 do_symlinkat+0x136/0x3a0 fs/namei.c:4505 __do_sys_symlink fs/namei.c:4528 [inline] __se_sys_symlink fs/namei.c:4526 [inline] __x64_sys_symlink+0x7e/0x90 fs/namei.c:4526 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 Memory state around the buggy address: ffff888057061680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888057061700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888057061780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888057061800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888057061880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================