loop3: detected capacity change from 0 to 32768
==================================================================
BUG: KASAN: slab-out-of-bounds in bch2_sb_downgrade_to_text+0x58d/0x680 fs/bcachefs/sb-downgrade.c:185
Read of size 2 at addr ffff88802d612000 by task syz-executor.3/9563
CPU: 1 PID: 9563 Comm: syz-executor.3 Not tainted 6.9.0-rc6-syzkaller-00290-gb9158815de52 #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+0x116/0x1f0 lib/dump_stack.c:114
print_address_description mm/kasan/report.c:377 [inline]
print_report+0xc3/0x620 mm/kasan/report.c:488
kasan_report+0xd9/0x110 mm/kasan/report.c:601
bch2_sb_downgrade_to_text+0x58d/0x680 fs/bcachefs/sb-downgrade.c:185
__bch2_sb_field_to_text+0x126/0x1e0 fs/bcachefs/super-io.c:1228
bch2_sb_field_validate+0x248/0x2d0 fs/bcachefs/super-io.c:1211
bch2_sb_validate.isra.0+0x6d8/0xce0 fs/bcachefs/super-io.c:468
__bch2_read_super+0x93c/0x12a0 fs/bcachefs/super-io.c:822
bch2_fs_open+0x3e5/0x1110 fs/bcachefs/super.c:2049
bch2_mount+0xdcc/0x1130 fs/bcachefs/fs.c:1903
legacy_get_tree+0x10c/0x220 fs/fs_context.c:662
vfs_get_tree+0x92/0x380 fs/super.c:1779
do_new_mount fs/namespace.c:3352 [inline]
path_mount+0x14e6/0x1f20 fs/namespace.c:3679
do_mount fs/namespace.c:3692 [inline]
__do_sys_mount fs/namespace.c:3898 [inline]
__se_sys_mount fs/namespace.c:3875 [inline]
__x64_sys_mount+0x297/0x320 fs/namespace.c:3875
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f688aa7f3aa
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:00007f688b756ef8 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f688b756f80 RCX: 00007f688aa7f3aa
RDX: 0000000020011a00 RSI: 0000000020000000 RDI: 00007f688b756f40
RBP: 0000000020011a00 R08: 00007f688b756f80 R09: 0000000003a04000
R10: 0000000003a04000 R11: 0000000000000202 R12: 0000000020000000
R13: 00007f688b756f40 R14: 0000000000011a04 R15: 0000000020000600
Allocated by task 9563:
kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
kasan_save_track+0x14/0x30 mm/kasan/common.c:68
poison_kmalloc_redzone mm/kasan/common.c:370 [inline]
__kasan_kmalloc+0xaa/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+0x220/0x470 mm/slub.c:3986
__do_krealloc mm/slab_common.c:1192 [inline]
krealloc+0x5d/0x100 mm/slab_common.c:1225
bch2_sb_realloc+0x242/0x5d0 fs/bcachefs/super-io.c:189
read_one_super+0x318/0x12a0 fs/bcachefs/super-io.c:659
__bch2_read_super+0x4d6/0x12a0 fs/bcachefs/super-io.c:750
bch2_fs_open+0x3e5/0x1110 fs/bcachefs/super.c:2049
bch2_mount+0xdcc/0x1130 fs/bcachefs/fs.c:1903
legacy_get_tree+0x10c/0x220 fs/fs_context.c:662
vfs_get_tree+0x92/0x380 fs/super.c:1779
do_new_mount fs/namespace.c:3352 [inline]
path_mount+0x14e6/0x1f20 fs/namespace.c:3679
do_mount fs/namespace.c:3692 [inline]
__do_sys_mount fs/namespace.c:3898 [inline]
__se_sys_mount fs/namespace.c:3875 [inline]
__x64_sys_mount+0x297/0x320 fs/namespace.c:3875
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
The buggy address belongs to the object at ffff88802d610000
which belongs to the cache kmalloc-8k of size 8192
The buggy address is located 0 bytes to the right of
allocated 8192-byte region [ffff88802d610000, ffff88802d612000)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2d610
head: order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
anon flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff888015042280 ffffea0001f36a00 dead000000000005
raw: 0000000000000000 0000000000020002 00000001ffffffff 0000000000000000
head: 00fff00000000840 ffff888015042280 ffffea0001f36a00 dead000000000005
head: 0000000000000000 0000000000020002 00000001ffffffff 0000000000000000
head: 00fff00000000003 ffffea0000b58401 ffffea0000b58448 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 0xd28c0(GFP_NOWAIT|__GFP_IO|__GFP_FS|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4750, tgid 672090073 (dhcpcd), ts 4750, free_ts 73594684350
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1534
prep_new_page mm/page_alloc.c:1541 [inline]
get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3317
__alloc_pages+0x22b/0x2460 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 mm/slub.c:2175 [inline]
allocate_slab mm/slub.c:2338 [inline]
new_slab+0xcc/0x3a0 mm/slub.c:2391
___slab_alloc+0x66d/0x1790 mm/slub.c:3525
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3610
__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_track_caller+0x367/0x470 mm/slub.c:3986
kmalloc_reserve+0xef/0x2c0 net/core/skbuff.c:599
__alloc_skb+0x164/0x380 net/core/skbuff.c:668
alloc_skb include/linux/skbuff.h:1313 [inline]
netlink_dump+0x2b2/0xe00 net/netlink/af_netlink.c:2229
netlink_recvmsg+0xa0d/0xf30 net/netlink/af_netlink.c:1987
sock_recvmsg_nosec net/socket.c:1046 [inline]
sock_recvmsg+0x1f9/0x250 net/socket.c:1068
____sys_recvmsg+0x21f/0x6b0 net/socket.c:2803
___sys_recvmsg+0x115/0x1a0 net/socket.c:2845
__sys_recvmsg+0x114/0x1e0 net/socket.c:2875
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
page last free pid 4850 tgid 4850 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+0x527/0xb10 mm/page_alloc.c:2347
free_unref_page+0x33/0x3c0 mm/page_alloc.c:2487
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x69/0x90 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]
kmem_cache_alloc+0x136/0x320 mm/slub.c:3852
getname_flags.part.0+0x50/0x4f0 fs/namei.c:139
getname_flags include/linux/audit.h:322 [inline]
getname+0x8f/0xe0 fs/namei.c:218
do_sys_openat2+0x104/0x1e0 fs/open.c:1400
do_sys_open fs/open.c:1421 [inline]
__do_sys_openat fs/open.c:1437 [inline]
__se_sys_openat fs/open.c:1432 [inline]
__x64_sys_openat+0x175/0x210 fs/open.c:1432
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Memory state around the buggy address:
ffff88802d611f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88802d611f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88802d612000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff88802d612080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88802d612100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
==================================================================
BUG: KASAN: slab-out-of-bounds in bch2_sb_downgrade_to_text+0x58d/0x680 fs/bcachefs/sb-downgrade.c:185
Read of size 2 at addr ffff88802d612002 by task syz-executor.3/9563
CPU: 1 PID: 9563 Comm: syz-executor.3 Tainted: G B 6.9.0-rc6-syzkaller-00290-gb9158815de52 #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+0x116/0x1f0 lib/dump_stack.c:114
print_address_description mm/kasan/report.c:377 [inline]
print_report+0xc3/0x620 mm/kasan/report.c:488
kasan_report+0xd9/0x110 mm/kasan/report.c:601
bch2_sb_downgrade_to_text+0x58d/0x680 fs/bcachefs/sb-downgrade.c:185
__bch2_sb_field_to_text+0x126/0x1e0 fs/bcachefs/super-io.c:1228
bch2_sb_field_validate+0x248/0x2d0 fs/bcachefs/super-io.c:1211
bch2_sb_validate.isra.0+0x6d8/0xce0 fs/bcachefs/super-io.c:468
__bch2_read_super+0x93c/0x12a0 fs/bcachefs/super-io.c:822
bch2_fs_open+0x3e5/0x1110 fs/bcachefs/super.c:2049
bch2_mount+0xdcc/0x1130 fs/bcachefs/fs.c:1903
legacy_get_tree+0x10c/0x220 fs/fs_context.c:662
vfs_get_tree+0x92/0x380 fs/super.c:1779
do_new_mount fs/namespace.c:3352 [inline]
path_mount+0x14e6/0x1f20 fs/namespace.c:3679
do_mount fs/namespace.c:3692 [inline]
__do_sys_mount fs/namespace.c:3898 [inline]
__se_sys_mount fs/namespace.c:3875 [inline]
__x64_sys_mount+0x297/0x320 fs/namespace.c:3875
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f688aa7f3aa
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:00007f688b756ef8 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f688b756f80 RCX: 00007f688aa7f3aa
RDX: 0000000020011a00 RSI: 0000000020000000 RDI: 00007f688b756f40
RBP: 0000000020011a00 R08: 00007f688b756f80 R09: 0000000003a04000
R10: 0000000003a04000 R11: 0000000000000202 R12: 0000000020000000
R13: 00007f688b756f40 R14: 0000000000011a04 R15: 0000000020000600
Allocated by task 9563:
kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
kasan_save_track+0x14/0x30 mm/kasan/common.c:68
poison_kmalloc_redzone mm/kasan/common.c:370 [inline]
__kasan_kmalloc+0xaa/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+0x220/0x470 mm/slub.c:3986
__do_krealloc mm/slab_common.c:1192 [inline]
krealloc+0x5d/0x100 mm/slab_common.c:1225
bch2_sb_realloc+0x242/0x5d0 fs/bcachefs/super-io.c:189
read_one_super+0x318/0x12a0 fs/bcachefs/super-io.c:659
__bch2_read_super+0x4d6/0x12a0 fs/bcachefs/super-io.c:750
bch2_fs_open+0x3e5/0x1110 fs/bcachefs/super.c:2049
bch2_mount+0xdcc/0x1130 fs/bcachefs/fs.c:1903
legacy_get_tree+0x10c/0x220 fs/fs_context.c:662
vfs_get_tree+0x92/0x380 fs/super.c:1779
do_new_mount fs/namespace.c:3352 [inline]
path_mount+0x14e6/0x1f20 fs/namespace.c:3679
do_mount fs/namespace.c:3692 [inline]
__do_sys_mount fs/namespace.c:3898 [inline]
__se_sys_mount fs/namespace.c:3875 [inline]
__x64_sys_mount+0x297/0x320 fs/namespace.c:3875
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
The buggy address belongs to the object at ffff88802d610000
which belongs to the cache kmalloc-8k of size 8192
The buggy address is located 2 bytes to the right of
allocated 8192-byte region [ffff88802d610000, ffff88802d612000)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2d610
head: order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
anon flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff888015042280 ffffea0001f36a00 dead000000000005
raw: 0000000000000000 0000000000020002 00000001ffffffff 0000000000000000
head: 00fff00000000840 ffff888015042280 ffffea0001f36a00 dead000000000005
head: 0000000000000000 0000000000020002 00000001ffffffff 0000000000000000
head: 00fff00000000003 ffffea0000b58401 ffffea0000b58448 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 0xd28c0(GFP_NOWAIT|__GFP_IO|__GFP_FS|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4750, tgid 672090073 (dhcpcd), ts 4750, free_ts 73594684350
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1534
prep_new_page mm/page_alloc.c:1541 [inline]
get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3317
__alloc_pages+0x22b/0x2460 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 mm/slub.c:2175 [inline]
allocate_slab mm/slub.c:2338 [inline]
new_slab+0xcc/0x3a0 mm/slub.c:2391
___slab_alloc+0x66d/0x1790 mm/slub.c:3525
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3610
__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_track_caller+0x367/0x470 mm/slub.c:3986
kmalloc_reserve+0xef/0x2c0 net/core/skbuff.c:599
__alloc_skb+0x164/0x380 net/core/skbuff.c:668
alloc_skb include/linux/skbuff.h:1313 [inline]
netlink_dump+0x2b2/0xe00 net/netlink/af_netlink.c:2229
netlink_recvmsg+0xa0d/0xf30 net/netlink/af_netlink.c:1987
sock_recvmsg_nosec net/socket.c:1046 [inline]
sock_recvmsg+0x1f9/0x250 net/socket.c:1068
____sys_recvmsg+0x21f/0x6b0 net/socket.c:2803
___sys_recvmsg+0x115/0x1a0 net/socket.c:2845
__sys_recvmsg+0x114/0x1e0 net/socket.c:2875
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
page last free pid 4850 tgid 4850 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+0x527/0xb10 mm/page_alloc.c:2347
free_unref_page+0x33/0x3c0 mm/page_alloc.c:2487
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x69/0x90 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]
kmem_cache_alloc+0x136/0x320 mm/slub.c:3852
getname_flags.part.0+0x50/0x4f0 fs/namei.c:139
getname_flags include/linux/audit.h:322 [inline]
getname+0x8f/0xe0 fs/namei.c:218
do_sys_openat2+0x104/0x1e0 fs/open.c:1400
do_sys_open fs/open.c:1421 [inline]
__do_sys_openat fs/open.c:1437 [inline]
__se_sys_openat fs/open.c:1432 [inline]
__x64_sys_openat+0x175/0x210 fs/open.c:1432
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Memory state around the buggy address:
ffff88802d611f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88802d611f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88802d612000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff88802d612080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88802d612100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
==================================================================
BUG: KASAN: slab-out-of-bounds in bch2_sb_downgrade_to_text+0x58d/0x680 fs/bcachefs/sb-downgrade.c:185
Read of size 2 at addr ffff88802d612004 by task syz-executor.3/9563
CPU: 1 PID: 9563 Comm: syz-executor.3 Tainted: G B 6.9.0-rc6-syzkaller-00290-gb9158815de52 #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+0x116/0x1f0 lib/dump_stack.c:114
print_address_description mm/kasan/report.c:377 [inline]
print_report+0xc3/0x620 mm/kasan/report.c:488
kasan_report+0xd9/0x110 mm/kasan/report.c:601
bch2_sb_downgrade_to_text+0x58d/0x680 fs/bcachefs/sb-downgrade.c:185
__bch2_sb_field_to_text+0x126/0x1e0 fs/bcachefs/super-io.c:1228
bch2_sb_field_validate+0x248/0x2d0 fs/bcachefs/super-io.c:1211
bch2_sb_validate.isra.0+0x6d8/0xce0 fs/bcachefs/super-io.c:468
__bch2_read_super+0x93c/0x12a0 fs/bcachefs/super-io.c:822
bch2_fs_open+0x3e5/0x1110 fs/bcachefs/super.c:2049
bch2_mount+0xdcc/0x1130 fs/bcachefs/fs.c:1903
legacy_get_tree+0x10c/0x220 fs/fs_context.c:662
vfs_get_tree+0x92/0x380 fs/super.c:1779
do_new_mount fs/namespace.c:3352 [inline]
path_mount+0x14e6/0x1f20 fs/namespace.c:3679
do_mount fs/namespace.c:3692 [inline]
__do_sys_mount fs/namespace.c:3898 [inline]
__se_sys_mount fs/namespace.c:3875 [inline]
__x64_sys_mount+0x297/0x320 fs/namespace.c:3875
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f688aa7f3aa
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:00007f688b756ef8 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f688b756f80 RCX: 00007f688aa7f3aa
RDX: 0000000020011a00 RSI: 0000000020000000 RDI: 00007f688b756f40
RBP: 0000000020011a00 R08: 00007f688b756f80 R09: 0000000003a04000
R10: 0000000003a04000 R11: 0000000000000202 R12: 0000000020000000
R13: 00007f688b756f40 R14: 0000000000011a04 R15: 0000000020000600
Allocated by task 9563:
kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
kasan_save_track+0x14/0x30 mm/kasan/common.c:68
poison_kmalloc_redzone mm/kasan/common.c:370 [inline]
__kasan_kmalloc+0xaa/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+0x220/0x470 mm/slub.c:3986
__do_krealloc mm/slab_common.c:1192 [inline]
krealloc+0x5d/0x100 mm/slab_common.c:1225
bch2_sb_realloc+0x242/0x5d0 fs/bcachefs/super-io.c:189
read_one_super+0x318/0x12a0 fs/bcachefs/super-io.c:659
__bch2_read_super+0x4d6/0x12a0 fs/bcachefs/super-io.c:750
bch2_fs_open+0x3e5/0x1110 fs/bcachefs/super.c:2049
bch2_mount+0xdcc/0x1130 fs/bcachefs/fs.c:1903
legacy_get_tree+0x10c/0x220 fs/fs_context.c:662
vfs_get_tree+0x92/0x380 fs/super.c:1779
do_new_mount fs/namespace.c:3352 [inline]
path_mount+0x14e6/0x1f20 fs/namespace.c:3679
do_mount fs/namespace.c:3692 [inline]
__do_sys_mount fs/namespace.c:3898 [inline]
__se_sys_mount fs/namespace.c:3875 [inline]
__x64_sys_mount+0x297/0x320 fs/namespace.c:3875
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
The buggy address belongs to the object at ffff88802d610000
which belongs to the cache kmalloc-8k of size 8192
The buggy address is located 4 bytes to the right of
allocated 8192-byte region [ffff88802d610000, ffff88802d612000)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2d610
head: order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
anon flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff888015042280 ffffea0001f36a00 dead000000000005
raw: 0000000000000000 0000000000020002 00000001ffffffff 0000000000000000
head: 00fff00000000840 ffff888015042280 ffffea0001f36a00 dead000000000005
head: 0000000000000000 0000000000020002 00000001ffffffff 0000000000000000
head: 00fff00000000003 ffffea0000b58401 ffffea0000b58448 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 0xd28c0(GFP_NOWAIT|__GFP_IO|__GFP_FS|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4750, tgid 672090073 (dhcpcd), ts 4750, free_ts 73594684350
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1534
prep_new_page mm/page_alloc.c:1541 [inline]
get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3317
__alloc_pages+0x22b/0x2460 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 mm/slub.c:2175 [inline]
allocate_slab mm/slub.c:2338 [inline]
new_slab+0xcc/0x3a0 mm/slub.c:2391
___slab_alloc+0x66d/0x1790 mm/slub.c:3525
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3610
__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_track_caller+0x367/0x470 mm/slub.c:3986
kmalloc_reserve+0xef/0x2c0 net/core/skbuff.c:599
__alloc_skb+0x164/0x380 net/core/skbuff.c:668
alloc_skb include/linux/skbuff.h:1313 [inline]
netlink_dump+0x2b2/0xe00 net/netlink/af_netlink.c:2229
netlink_recvmsg+0xa0d/0xf30 net/netlink/af_netlink.c:1987
sock_recvmsg_nosec net/socket.c:1046 [inline]
sock_recvmsg+0x1f9/0x250 net/socket.c:1068
____sys_recvmsg+0x21f/0x6b0 net/socket.c:2803
___sys_recvmsg+0x115/0x1a0 net/socket.c:2845
__sys_recvmsg+0x114/0x1e0 net/socket.c:2875
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
page last free pid 4850 tgid 4850 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+0x527/0xb10 mm/page_alloc.c:2347
free_unref_page+0x33/0x3c0 mm/page_alloc.c:2487
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x69/0x90 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]
kmem_cache_alloc+0x136/0x320 mm/slub.c:3852
getname_flags.part.0+0x50/0x4f0 fs/namei.c:139
getname_flags include/linux/audit.h:322 [inline]
getname+0x8f/0xe0 fs/namei.c:218
do_sys_openat2+0x104/0x1e0 fs/open.c:1400
do_sys_open fs/open.c:1421 [inline]
__do_sys_openat fs/open.c:1437 [inline]
__se_sys_openat fs/open.c:1432 [inline]
__x64_sys_openat+0x175/0x210 fs/open.c:1432
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Memory state around the buggy address:
ffff88802d611f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88802d611f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88802d612000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff88802d612080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88802d612100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
==================================================================
BUG: KASAN: slab-out-of-bounds in bch2_sb_downgrade_to_text+0x58d/0x680 fs/bcachefs/sb-downgrade.c:185
Read of size 2 at addr ffff88802d612006 by task syz-executor.3/9563
CPU: 1 PID: 9563 Comm: syz-executor.3 Tainted: G B 6.9.0-rc6-syzkaller-00290-gb9158815de52 #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+0x116/0x1f0 lib/dump_stack.c:114
print_address_description mm/kasan/report.c:377 [inline]
print_report+0xc3/0x620 mm/kasan/report.c:488
kasan_report+0xd9/0x110 mm/kasan/report.c:601
bch2_sb_downgrade_to_text+0x58d/0x680 fs/bcachefs/sb-downgrade.c:185
__bch2_sb_field_to_text+0x126/0x1e0 fs/bcachefs/super-io.c:1228
bch2_sb_field_validate+0x248/0x2d0 fs/bcachefs/super-io.c:1211
bch2_sb_validate.isra.0+0x6d8/0xce0 fs/bcachefs/super-io.c:468
__bch2_read_super+0x93c/0x12a0 fs/bcachefs/super-io.c:822
bch2_fs_open+0x3e5/0x1110 fs/bcachefs/super.c:2049
bch2_mount+0xdcc/0x1130 fs/bcachefs/fs.c:1903
legacy_get_tree+0x10c/0x220 fs/fs_context.c:662
vfs_get_tree+0x92/0x380 fs/super.c:1779
do_new_mount fs/namespace.c:3352 [inline]
path_mount+0x14e6/0x1f20 fs/namespace.c:3679
do_mount fs/namespace.c:3692 [inline]
__do_sys_mount fs/namespace.c:3898 [inline]
__se_sys_mount fs/namespace.c:3875 [inline]
__x64_sys_mount+0x297/0x320 fs/namespace.c:3875
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f688aa7f3aa
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:00007f688b756ef8 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f688b756f80 RCX: 00007f688aa7f3aa
RDX: 0000000020011a00 RSI: 0000000020000000 RDI: 00007f688b756f40
RBP: 0000000020011a00 R08: 00007f688b756f80 R09: 0000000003a04000
R10: 0000000003a04000 R11: 0000000000000202 R12: 0000000020000000
R13: 00007f688b756f40 R14: 0000000000011a04 R15: 0000000020000600
Allocated by task 9563:
kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
kasan_save_track+0x14/0x30 mm/kasan/common.c:68
poison_kmalloc_redzone mm/kasan/common.c:370 [inline]
__kasan_kmalloc+0xaa/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+0x220/0x470 mm/slub.c:3986
__do_krealloc mm/slab_common.c:1192 [inline]
krealloc+0x5d/0x100 mm/slab_common.c:1225
bch2_sb_realloc+0x242/0x5d0 fs/bcachefs/super-io.c:189
read_one_super+0x318/0x12a0 fs/bcachefs/super-io.c:659
__bch2_read_super+0x4d6/0x12a0 fs/bcachefs/super-io.c:750
bch2_fs_open+0x3e5/0x1110 fs/bcachefs/super.c:2049
bch2_mount+0xdcc/0x1130 fs/bcachefs/fs.c:1903
legacy_get_tree+0x10c/0x220 fs/fs_context.c:662
vfs_get_tree+0x92/0x380 fs/super.c:1779
do_new_mount fs/namespace.c:3352 [inline]
path_mount+0x14e6/0x1f20 fs/namespace.c:3679
do_mount fs/namespace.c:3692 [inline]
__do_sys_mount fs/namespace.c:3898 [inline]
__se_sys_mount fs/namespace.c:3875 [inline]
__x64_sys_mount+0x297/0x320 fs/namespace.c:3875
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
The buggy address belongs to the object at ffff88802d610000
which belongs to the cache kmalloc-8k of size 8192
The buggy address is located 6 bytes to the right of
allocated 8192-byte region [ffff88802d610000, ffff88802d612000)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2d610
head: order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
anon flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff888015042280 ffffea0001f36a00 dead000000000005
raw: 0000000000000000 0000000000020002 00000001ffffffff 0000000000000000
head: 00fff00000000840 ffff888015042280 ffffea0001f36a00 dead000000000005
head: 0000000000000000 0000000000020002 00000001ffffffff 0000000000000000
head: 00fff00000000003 ffffea0000b58401 ffffea0000b58448 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 0xd28c0(GFP_NOWAIT|__GFP_IO|__GFP_FS|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4750, tgid 672090073 (dhcpcd), ts 4750, free_ts 73594684350
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1534
prep_new_page mm/page_alloc.c:1541 [inline]
get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3317
__alloc_pages+0x22b/0x2460 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 mm/slub.c:2175 [inline]
allocate_slab mm/slub.c:2338 [inline]
new_slab+0xcc/0x3a0 mm/slub.c:2391
___slab_alloc+0x66d/0x1790 mm/slub.c:3525
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3610
__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_track_caller+0x367/0x470 mm/slub.c:3986
kmalloc_reserve+0xef/0x2c0 net/core/skbuff.c:599
__alloc_skb+0x164/0x380 net/core/skbuff.c:668
alloc_skb include/linux/skbuff.h:1313 [inline]
netlink_dump+0x2b2/0xe00 net/netlink/af_netlink.c:2229
netlink_recvmsg+0xa0d/0xf30 net/netlink/af_netlink.c:1987
sock_recvmsg_nosec net/socket.c:1046 [inline]
sock_recvmsg+0x1f9/0x250 net/socket.c:1068
____sys_recvmsg+0x21f/0x6b0 net/socket.c:2803
___sys_recvmsg+0x115/0x1a0 net/socket.c:2845
__sys_recvmsg+0x114/0x1e0 net/socket.c:2875
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
page last free pid 4850 tgid 4850 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+0x527/0xb10 mm/page_alloc.c:2347
free_unref_page+0x33/0x3c0 mm/page_alloc.c:2487
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x69/0x90 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]
kmem_cache_alloc+0x136/0x320 mm/slub.c:3852
getname_flags.part.0+0x50/0x4f0 fs/namei.c:139
getname_flags include/linux/audit.h:322 [inline]
getname+0x8f/0xe0 fs/namei.c:218
do_sys_openat2+0x104/0x1e0 fs/open.c:1400
do_sys_open fs/open.c:1421 [inline]
__do_sys_openat fs/open.c:1437 [inline]
__se_sys_openat fs/open.c:1432 [inline]
__x64_sys_openat+0x175/0x210 fs/open.c:1432
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Memory state around the buggy address:
ffff88802d611f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88802d611f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88802d612000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff88802d612080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88802d612100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
==================================================================
BUG: KASAN: slab-out-of-bounds in bch2_sb_downgrade_to_text+0x58d/0x680 fs/bcachefs/sb-downgrade.c:185
Read of size 2 at addr ffff88802d612008 by task syz-executor.3/9563
CPU: 0 PID: 9563 Comm: syz-executor.3 Tainted: G B 6.9.0-rc6-syzkaller-00290-gb9158815de52 #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+0x116/0x1f0 lib/dump_stack.c:114
print_address_description mm/kasan/report.c:377 [inline]
print_report+0xc3/0x620 mm/kasan/report.c:488
kasan_report+0xd9/0x110 mm/kasan/report.c:601
bch2_sb_downgrade_to_text+0x58d/0x680 fs/bcachefs/sb-downgrade.c:185
__bch2_sb_field_to_text+0x126/0x1e0 fs/bcachefs/super-io.c:1228
bch2_sb_field_validate+0x248/0x2d0 fs/bcachefs/super-io.c:1211
bch2_sb_validate.isra.0+0x6d8/0xce0 fs/bcachefs/super-io.c:468
__bch2_read_super+0x93c/0x12a0 fs/bcachefs/super-io.c:822
bch2_fs_open+0x3e5/0x1110 fs/bcachefs/super.c:2049
bch2_mount+0xdcc/0x1130 fs/bcachefs/fs.c:1903
legacy_get_tree+0x10c/0x220 fs/fs_context.c:662
vfs_get_tree+0x92/0x380 fs/super.c:1779
do_new_mount fs/namespace.c:3352 [inline]
path_mount+0x14e6/0x1f20 fs/namespace.c:3679
do_mount fs/namespace.c:3692 [inline]
__do_sys_mount fs/namespace.c:3898 [inline]
__se_sys_mount fs/namespace.c:3875 [inline]
__x64_sys_mount+0x297/0x320 fs/namespace.c:3875
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f688aa7f3aa
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:00007f688b756ef8 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f688b756f80 RCX: 00007f688aa7f3aa
RDX: 0000000020011a00 RSI: 0000000020000000 RDI: 00007f688b756f40
RBP: 0000000020011a00 R08: 00007f688b756f80 R09: 0000000003a04000
R10: 0000000003a04000 R11: 0000000000000202 R12: 0000000020000000
R13: 00007f688b756f40 R14: 0000000000011a04 R15: 0000000020000600
Allocated by task 9563:
kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
kasan_save_track+0x14/0x30 mm/kasan/common.c:68
poison_kmalloc_redzone mm/kasan/common.c:370 [inline]
__kasan_kmalloc+0xaa/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+0x220/0x470 mm/slub.c:3986
__do_krealloc mm/slab_common.c:1192 [inline]
krealloc+0x5d/0x100 mm/slab_common.c:1225
bch2_sb_realloc+0x242/0x5d0 fs/bcachefs/super-io.c:189
read_one_super+0x318/0x12a0 fs/bcachefs/super-io.c:659
__bch2_read_super+0x4d6/0x12a0 fs/bcachefs/super-io.c:750
bch2_fs_open+0x3e5/0x1110 fs/bcachefs/super.c:2049
bch2_mount+0xdcc/0x1130 fs/bcachefs/fs.c:1903
legacy_get_tree+0x10c/0x220 fs/fs_context.c:662
vfs_get_tree+0x92/0x380 fs/super.c:1779
do_new_mount fs/namespace.c:3352 [inline]
path_mount+0x14e6/0x1f20 fs/namespace.c:3679
do_mount fs/namespace.c:3692 [inline]
__do_sys_mount fs/namespace.c:3898 [inline]
__se_sys_mount fs/namespace.c:3875 [inline]
__x64_sys_mount+0x297/0x320 fs/namespace.c:3875
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
The buggy address belongs to the object at ffff88802d610000
which belongs to the cache kmalloc-8k of size 8192
The buggy address is located 8 bytes to the right of
allocated 8192-byte region [ffff88802d610000, ffff88802d612000)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2d610
head: order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
anon flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff888015042280 ffffea0001f36a00 dead000000000005
raw: 0000000000000000 0000000000020002 00000001ffffffff 0000000000000000
head: 00fff00000000840 ffff888015042280 ffffea0001f36a00 dead000000000005
head: 0000000000000000 0000000000020002 00000001ffffffff 0000000000000000
head: 00fff00000000003 ffffea0000b58401 ffffea0000b58448 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 0xd28c0(GFP_NOWAIT|__GFP_IO|__GFP_FS|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4750, tgid 672090073 (dhcpcd), ts 4750, free_ts 73594684350
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1534
prep_new_page mm/page_alloc.c:1541 [inline]
get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3317
__alloc_pages+0x22b/0x2460 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 mm/slub.c:2175 [inline]
allocate_slab mm/slub.c:2338 [inline]
new_slab+0xcc/0x3a0 mm/slub.c:2391
___slab_alloc+0x66d/0x1790 mm/slub.c:3525
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3610
__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_track_caller+0x367/0x470 mm/slub.c:3986
kmalloc_reserve+0xef/0x2c0 net/core/skbuff.c:599
__alloc_skb+0x164/0x380 net/core/skbuff.c:668
alloc_skb include/linux/skbuff.h:1313 [inline]
netlink_dump+0x2b2/0xe00 net/netlink/af_netlink.c:2229
netlink_recvmsg+0xa0d/0xf30 net/netlink/af_netlink.c:1987
sock_recvmsg_nosec net/socket.c:1046 [inline]
sock_recvmsg+0x1f9/0x250 net/socket.c:1068
____sys_recvmsg+0x21f/0x6b0 net/socket.c:2803
___sys_recvmsg+0x115/0x1a0 net/socket.c:2845
__sys_recvmsg+0x114/0x1e0 net/socket.c:2875
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
page last free pid 4850 tgid 4850 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+0x527/0xb10 mm/page_alloc.c:2347
free_unref_page+0x33/0x3c0 mm/page_alloc.c:2487
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x69/0x90 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]
kmem_cache_alloc+0x136/0x320 mm/slub.c:3852
getname_flags.part.0+0x50/0x4f0 fs/namei.c:139
getname_flags include/linux/audit.h:322 [inline]
getname+0x8f/0xe0 fs/namei.c:218
do_sys_openat2+0x104/0x1e0 fs/open.c:1400
do_sys_open fs/open.c:1421 [inline]
__do_sys_openat fs/open.c:1437 [inline]
__se_sys_openat fs/open.c:1432 [inline]
__x64_sys_openat+0x175/0x210 fs/open.c:1432
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Memory state around the buggy address:
ffff88802d611f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88802d611f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88802d612000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff88802d612080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88802d612100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
==================================================================
BUG: KASAN: slab-out-of-bounds in bch2_sb_downgrade_to_text+0x58d/0x680 fs/bcachefs/sb-downgrade.c:185
Read of size 2 at addr ffff88802d61200a by task syz-executor.3/9563
CPU: 1 PID: 9563 Comm: syz-executor.3 Tainted: G B 6.9.0-rc6-syzkaller-00290-gb9158815de52 #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+0x116/0x1f0 lib/dump_stack.c:114
print_address_description mm/kasan/report.c:377 [inline]
print_report+0xc3/0x620 mm/kasan/report.c:488
kasan_report+0xd9/0x110 mm/kasan/report.c:601
bch2_sb_downgrade_to_text+0x58d/0x680 fs/bcachefs/sb-downgrade.c:185
__bch2_sb_field_to_text+0x126/0x1e0 fs/bcachefs/super-io.c:1228
bch2_sb_field_validate+0x248/0x2d0 fs/bcachefs/super-io.c:1211
bch2_sb_validate.isra.0+0x6d8/0xce0 fs/bcachefs/super-io.c:468
__bch2_read_super+0x93c/0x12a0 fs/bcachefs/super-io.c:822
bch2_fs_open+0x3e5/0x1110 fs/bcachefs/super.c:2049
bch2_mount+0xdcc/0x1130 fs/bcachefs/fs.c:1903
legacy_get_tree+0x10c/0x220 fs/fs_context.c:662
vfs_get_tree+0x92/0x380 fs/super.c:1779
do_new_mount fs/namespace.c:3352 [inline]
path_mount+0x14e6/0x1f20 fs/namespace.c:3679
do_mount fs/namespace.c:3692 [inline]
__do_sys_mount fs/namespace.c:3898 [inline]
__se_sys_mount fs/namespace.c:3875 [inline]
__x64_sys_mount+0x297/0x320 fs/namespace.c:3875
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f688aa7f3aa
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:00007f688b756ef8 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f688b756f80 RCX: 00007f688aa7f3aa
RDX: 0000000020011a00 RSI: 0000000020000000 RDI: 00007f688b756f40
RBP: 0000000020011a00 R08: 00007f688b756f80 R09: 0000000003a04000
R10: 0000000003a04000 R11: 0000000000000202 R12: 0000000020000000
R13: 00007f688b756f40 R14: 0000000000011a04 R15: 0000000020000600
Allocated by task 9563:
kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
kasan_save_track+0x14/0x30 mm/kasan/common.c:68
poison_kmalloc_redzone mm/kasan/common.c:370 [inline]
__kasan_kmalloc+0xaa/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+0x220/0x470 mm/slub.c:3986
__do_krealloc mm/slab_common.c:1192 [inline]
krealloc+0x5d/0x100 mm/slab_common.c:1225
bch2_sb_realloc+0x242/0x5d0 fs/bcachefs/super-io.c:189
read_one_super+0x318/0x12a0 fs/bcachefs/super-io.c:659
__bch2_read_super+0x4d6/0x12a0 fs/bcachefs/super-io.c:750
bch2_fs_open+0x3e5/0x1110 fs/bcachefs/super.c:2049
bch2_mount+0xdcc/0x1130 fs/bcachefs/fs.c:1903
legacy_get_tree+0x10c/0x220 fs/fs_context.c:662
vfs_get_tree+0x92/0x380 fs/super.c:1779
do_new_mount fs/namespace.c:3352 [inline]
path_mount+0x14e6/0x1f20 fs/namespace.c:3679
do_mount fs/namespace.c:3692 [inline]
__do_sys_mount fs/namespace.c:3898 [inline]
__se_sys_mount fs/namespace.c:3875 [inline]
__x64_sys_mount+0x297/0x320 fs/namespace.c:3875
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
The buggy address belongs to the object at ffff88802d610000
which belongs to the cache kmalloc-8k of size 8192
The buggy address is located 10 bytes to the right of
allocated 8192-byte region [ffff88802d610000, ffff88802d612000)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2d610
head: order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
anon flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff888015042280 ffffea0001f36a00 dead000000000005
raw: 0000000000000000 0000000000020002 00000001ffffffff 0000000000000000
head: 00fff00000000840 ffff888015042280 ffffea0001f36a00 dead000000000005
head: 0000000000000000 0000000000020002 00000001ffffffff 0000000000000000
head: 00fff00000000003 ffffea0000b58401 ffffea0000b58448 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 0xd28c0(GFP_NOWAIT|__GFP_IO|__GFP_FS|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4750, tgid 672090073 (dhcpcd), ts 4750, free_ts 73594684350
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1534
prep_new_page mm/page_alloc.c:1541 [inline]
get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3317
__alloc_pages+0x22b/0x2460 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 mm/slub.c:2175 [inline]
allocate_slab mm/slub.c:2338 [inline]
new_slab+0xcc/0x3a0 mm/slub.c:2391
___slab_alloc+0x66d/0x1790 mm/slub.c:3525
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3610
__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_track_caller+0x367/0x470 mm/slub.c:3986
kmalloc_reserve+0xef/0x2c0 net/core/skbuff.c:599
__alloc_skb+0x164/0x380 net/core/skbuff.c:668
alloc_skb include/linux/skbuff.h:1313 [inline]
netlink_dump+0x2b2/0xe00 net/netlink/af_netlink.c:2229
netlink_recvmsg+0xa0d/0xf30 net/netlink/af_netlink.c:1987
sock_recvmsg_nosec net/socket.c:1046 [inline]
sock_recvmsg+0x1f9/0x250 net/socket.c:1068
____sys_recvmsg+0x21f/0x6b0 net/socket.c:2803
___sys_recvmsg+0x115/0x1a0 net/socket.c:2845
__sys_recvmsg+0x114/0x1e0 net/socket.c:2875
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
page last free pid 4850 tgid 4850 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+0x527/0xb10 mm/page_alloc.c:2347
free_unref_page+0x33/0x3c0 mm/page_alloc.c:2487
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x69/0x90 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]
kmem_cache_alloc+0x136/0x320 mm/slub.c:3852
getname_flags.part.0+0x50/0x4f0 fs/namei.c:139
getname_flags include/linux/audit.h:322 [inline]
getname+0x8f/0xe0 fs/namei.c:218
do_sys_openat2+0x104/0x1e0 fs/open.c:1400
do_sys_open fs/open.c:1421 [inline]
__do_sys_openat fs/open.c:1437 [inline]
__se_sys_openat fs/open.c:1432 [inline]
__x64_sys_openat+0x175/0x210 fs/open.c:1432
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Memory state around the buggy address:
ffff88802d611f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88802d611f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88802d612000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff88802d612080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88802d612100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
==================================================================
BUG: KASAN: slab-out-of-bounds in bch2_sb_downgrade_to_text+0x58d/0x680 fs/bcachefs/sb-downgrade.c:185
Read of size 2 at addr ffff88802d61200c by task syz-executor.3/9563
CPU: 0 PID: 9563 Comm: syz-executor.3 Tainted: G B 6.9.0-rc6-syzkaller-00290-gb9158815de52 #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+0x116/0x1f0 lib/dump_stack.c:114
print_address_description mm/kasan/report.c:377 [inline]
print_report+0xc3/0x620 mm/kasan/report.c:488
kasan_report+0xd9/0x110 mm/kasan/report.c:601
bch2_sb_downgrade_to_text+0x58d/0x680 fs/bcachefs/sb-downgrade.c:185
__bch2_sb_field_to_text+0x126/0x1e0 fs/bcachefs/super-io.c:1228
bch2_sb_field_validate+0x248/0x2d0 fs/bcachefs/super-io.c:1211
bch2_sb_validate.isra.0+0x6d8/0xce0 fs/bcachefs/super-io.c:468
__bch2_read_super+0x93c/0x12a0 fs/bcachefs/super-io.c:822
bch2_fs_open+0x3e5/0x1110 fs/bcachefs/super.c:2049
bch2_mount+0xdcc/0x1130 fs/bcachefs/fs.c:1903
legacy_get_tree+0x10c/0x220 fs/fs_context.c:662
vfs_get_tree+0x92/0x380 fs/super.c:1779
do_new_mount fs/namespace.c:3352 [inline]
path_mount+0x14e6/0x1f20 fs/namespace.c:3679
do_mount fs/namespace.c:3692 [inline]
__do_sys_mount fs/namespace.c:3898 [inline]
__se_sys_mount fs/namespace.c:3875 [inline]
__x64_sys_mount+0x297/0x320 fs/namespace.c:3875
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f688aa7f3aa
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:00007f688b756ef8 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f688b756f80 RCX: 00007f688aa7f3aa
RDX: 0000000020011a00 RSI: 0000000020000000 RDI: 00007f688b756f40
RBP: 0000000020011a00 R08: 00007f688b756f80 R09: 0000000003a04000
R10: 0000000003a04000 R11: 0000000000000202 R12: 0000000020000000
R13: 00007f688b756f40 R14: 0000000000011a04 R15: 0000000020000600
Allocated by task 9563:
kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
kasan_save_track+0x14/0x30 mm/kasan/common.c:68
poison_kmalloc_redzone mm/kasan/common.c:370 [inline]
__kasan_kmalloc+0xaa/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+0x220/0x470 mm/slub.c:3986
__do_krealloc mm/slab_common.c:1192 [inline]
krealloc+0x5d/0x100 mm/slab_common.c:1225
bch2_sb_realloc+0x242/0x5d0 fs/bcachefs/super-io.c:189
read_one_super+0x318/0x12a0 fs/bcachefs/super-io.c:659
__bch2_read_super+0x4d6/0x12a0 fs/bcachefs/super-io.c:750
bch2_fs_open+0x3e5/0x1110 fs/bcachefs/super.c:2049
bch2_mount+0xdcc/0x1130 fs/bcachefs/fs.c:1903
legacy_get_tree+0x10c/0x220 fs/fs_context.c:662
vfs_get_tree+0x92/0x380 fs/super.c:1779
do_new_mount fs/namespace.c:3352 [inline]
path_mount+0x14e6/0x1f20 fs/namespace.c:3679
do_mount fs/namespace.c:3692 [inline]
__do_sys_mount fs/namespace.c:3898 [inline]
__se_sys_mount fs/namespace.c:3875 [inline]
__x64_sys_mount+0x297/0x320 fs/namespace.c:3875
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
The buggy address belongs to the object at ffff88802d610000
which belongs to the cache kmalloc-8k of size 8192
The buggy address is located 12 bytes to the right of
allocated 8192-byte region [ffff88802d610000, ffff88802d612000)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2d610
head: order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
anon flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff888015042280 ffffea0001f36a00 dead000000000005
raw: 0000000000000000 0000000000020002 00000001ffffffff 0000000000000000
head: 00fff00000000840 ffff888015042280 ffffea0001f36a00 dead000000000005
head: 0000000000000000 0000000000020002 00000001ffffffff 0000000000000000
head: 00fff00000000003 ffffea0000b58401 ffffea0000b58448 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 0xd28c0(GFP_NOWAIT|__GFP_IO|__GFP_FS|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4750, tgid 672090073 (dhcpcd), ts 4750, free_ts 73594684350
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1534
prep_new_page mm/page_alloc.c:1541 [inline]
get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3317
__alloc_pages+0x22b/0x2460 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 mm/slub.c:2175 [inline]
allocate_slab mm/slub.c:2338 [inline]
new_slab+0xcc/0x3a0 mm/slub.c:2391
___slab_alloc+0x66d/0x1790 mm/slub.c:3525
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3610
__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_track_caller+0x367/0x470 mm/slub.c:3986
kmalloc_reserve+0xef/0x2c0 net/core/skbuff.c:599
__alloc_skb+0x164/0x380 net/core/skbuff.c:668
alloc_skb include/linux/skbuff.h:1313 [inline]
netlink_dump+0x2b2/0xe00 net/netlink/af_netlink.c:2229
netlink_recvmsg+0xa0d/0xf30 net/netlink/af_netlink.c:1987
sock_recvmsg_nosec net/socket.c:1046 [inline]
sock_recvmsg+0x1f9/0x250 net/socket.c:1068
____sys_recvmsg+0x21f/0x6b0 net/socket.c:2803
___sys_recvmsg+0x115/0x1a0 net/socket.c:2845
__sys_recvmsg+0x114/0x1e0 net/socket.c:2875
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
page last free pid 4850 tgid 4850 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+0x527/0xb10 mm/page_alloc.c:2347
free_unref_page+0x33/0x3c0 mm/page_alloc.c:2487
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x69/0x90 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]
kmem_cache_alloc+0x136/0x320 mm/slub.c:3852
getname_flags.part.0+0x50/0x4f0 fs/namei.c:139
getname_flags include/linux/audit.h:322 [inline]
getname+0x8f/0xe0 fs/namei.c:218
do_sys_openat2+0x104/0x1e0 fs/open.c:1400
do_sys_open fs/open.c:1421 [inline]
__do_sys_openat fs/open.c:1437 [inline]
__se_sys_openat fs/open.c:1432 [inline]
__x64_sys_openat+0x175/0x210 fs/open.c:1432
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Memory state around the buggy address:
ffff88802d611f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88802d611f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88802d612000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff88802d612080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88802d612100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
==================================================================
BUG: KASAN: slab-out-of-bounds in bch2_sb_downgrade_to_text+0x58d/0x680 fs/bcachefs/sb-downgrade.c:185
Read of size 2 at addr ffff88802d61200e by task syz-executor.3/9563
CPU: 1 PID: 9563 Comm: syz-executor.3 Tainted: G B 6.9.0-rc6-syzkaller-00290-gb9158815de52 #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+0x116/0x1f0 lib/dump_stack.c:114
print_address_description mm/kasan/report.c:377 [inline]
print_report+0xc3/0x620 mm/kasan/report.c:488
kasan_report+0xd9/0x110 mm/kasan/report.c:601
bch2_sb_downgrade_to_text+0x58d/0x680 fs/bcachefs/sb-downgrade.c:185
__bch2_sb_field_to_text+0x126/0x1e0 fs/bcachefs/super-io.c:1228
bch2_sb_field_validate+0x248/0x2d0 fs/bcachefs/super-io.c:1211
bch2_sb_validate.isra.0+0x6d8/0xce0 fs/bcachefs/super-io.c:468
__bch2_read_super+0x93c/0x12a0 fs/bcachefs/super-io.c:822
bch2_fs_open+0x3e5/0x1110 fs/bcachefs/super.c:2049
bch2_mount+0xdcc/0x1130 fs/bcachefs/fs.c:1903
legacy_get_tree+0x10c/0x220 fs/fs_context.c:662
vfs_get_tree+0x92/0x380 fs/super.c:1779
do_new_mount fs/namespace.c:3352 [inline]
path_mount+0x14e6/0x1f20 fs/namespace.c:3679
do_mount fs/namespace.c:3692 [inline]
__do_sys_mount fs/namespace.c:3898 [inline]
__se_sys_mount fs/namespace.c:3875 [inline]
__x64_sys_mount+0x297/0x320 fs/namespace.c:3875
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f688aa7f3aa
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:00007f688b756ef8 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f688b756f80 RCX: 00007f688aa7f3aa
RDX: 0000000020011a00 RSI: 0000000020000000 RDI: 00007f688b756f40
RBP: 0000000020011a00 R08: 00007f688b756f80 R09: 0000000003a04000
R10: 0000000003a04000 R11: 0000000000000202 R12: 0000000020000000
R13: 00007f688b756f40 R14: 0000000000011a04 R15: 0000000020000600
Allocated by task 9563:
kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
kasan_save_track+0x14/0x30 mm/kasan/common.c:68
poison_kmalloc_redzone mm/kasan/common.c:370 [inline]
__kasan_kmalloc+0xaa/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+0x220/0x470 mm/slub.c:3986
__do_krealloc mm/slab_common.c:1192 [inline]
krealloc+0x5d/0x100 mm/slab_common.c:1225
bch2_sb_realloc+0x242/0x5d0 fs/bcachefs/super-io.c:189
read_one_super+0x318/0x12a0 fs/bcachefs/super-io.c:659
__bch2_read_super+0x4d6/0x12a0 fs/bcachefs/super-io.c:750
bch2_fs_open+0x3e5/0x1110 fs/bcachefs/super.c:2049
bch2_mount+0xdcc/0x1130 fs/bcachefs/fs.c:1903
legacy_get_tree+0x10c/0x220 fs/fs_context.c:662
vfs_get_tree+0x92/0x380 fs/super.c:1779
do_new_mount fs/namespace.c:3352 [inline]
path_mount+0x14e6/0x1f20 fs/namespace.c:3679
do_mount fs/namespace.c:3692 [inline]
__do_sys_mount fs/namespace.c:3898 [inline]
__se_sys_mount fs/namespace.c:3875 [inline]
__x64_sys_mount+0x297/0x320 fs/namespace.c:3875
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
The buggy address belongs to the object at ffff88802d610000
which belongs to the cache kmalloc-8k of size 8192
The buggy address is located 14 bytes to the right of
allocated 8192-byte region [ffff88802d610000, ffff88802d612000)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2d610
head: order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
anon flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff888015042280 ffffea0001f36a00 dead000000000005
raw: 0000000000000000 0000000000020002 00000001ffffffff 0000000000000000
head: 00fff00000000840 ffff888015042280 ffffea0001f36a00 dead000000000005
head: 0000000000000000 0000000000020002 00000001ffffffff 0000000000000000
head: 00fff00000000003 ffffea0000b58401 ffffea0000b58448 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 0xd28c0(GFP_NOWAIT|__GFP_IO|__GFP_FS|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4750, tgid 672090073 (dhcpcd), ts 4750, free_ts 73594684350
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1534
prep_new_page mm/page_alloc.c:1541 [inline]
get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3317
__alloc_pages+0x22b/0x2460 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 mm/slub.c:2175 [inline]
allocate_slab mm/slub.c:2338 [inline]
new_slab+0xcc/0x3a0 mm/slub.c:2391
___slab_alloc+0x66d/0x1790 mm/slub.c:3525
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3610
__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_track_caller+0x367/0x470 mm/slub.c:3986
kmalloc_reserve+0xef/0x2c0 net/core/skbuff.c:599
__alloc_skb+0x164/0x380 net/core/skbuff.c:668
alloc_skb include/linux/skbuff.h:1313 [inline]
netlink_dump+0x2b2/0xe00 net/netlink/af_netlink.c:2229
netlink_recvmsg+0xa0d/0xf30 net/netlink/af_netlink.c:1987
sock_recvmsg_nosec net/socket.c:1046 [inline]
sock_recvmsg+0x1f9/0x250 net/socket.c:1068
____sys_recvmsg+0x21f/0x6b0 net/socket.c:2803
___sys_recvmsg+0x115/0x1a0 net/socket.c:2845
__sys_recvmsg+0x114/0x1e0 net/socket.c:2875
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
page last free pid 4850 tgid 4850 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+0x527/0xb10 mm/page_alloc.c:2347
free_unref_page+0x33/0x3c0 mm/page_alloc.c:2487
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x69/0x90 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]
kmem_cache_alloc+0x136/0x320 mm/slub.c:3852
getname_flags.part.0+0x50/0x4f0 fs/namei.c:139
getname_flags include/linux/audit.h:322 [inline]
getname+0x8f/0xe0 fs/namei.c:218
do_sys_openat2+0x104/0x1e0 fs/open.c:1400
do_sys_open fs/open.c:1421 [inline]
__do_sys_openat fs/open.c:1437 [inline]
__se_sys_openat fs/open.c:1432 [inline]
__x64_sys_openat+0x175/0x210 fs/open.c:1432
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Memory state around the buggy address:
ffff88802d611f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88802d611f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88802d612000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff88802d612080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88802d612100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
==================================================================
BUG: KASAN: slab-out-of-bounds in bch2_sb_downgrade_to_text+0x58d/0x680 fs/bcachefs/sb-downgrade.c:185
Read of size 2 at addr ffff88802d612010 by task syz-executor.3/9563
CPU: 1 PID: 9563 Comm: syz-executor.3 Tainted: G B 6.9.0-rc6-syzkaller-00290-gb9158815de52 #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+0x116/0x1f0 lib/dump_stack.c:114
print_address_description mm/kasan/report.c:377 [inline]
print_report+0xc3/0x620 mm/kasan/report.c:488
kasan_report+0xd9/0x110 mm/kasan/report.c:601
bch2_sb_downgrade_to_text+0x58d/0x680 fs/bcachefs/sb-downgrade.c:185
__bch2_sb_field_to_text+0x126/0x1e0 fs/bcachefs/super-io.c:1228
bch2_sb_field_validate+0x248/0x2d0 fs/bcachefs/super-io.c:1211
bch2_sb_validate.isra.0+0x6d8/0xce0 fs/bcachefs/super-io.c:468
__bch2_read_super+0x93c/0x12a0 fs/bcachefs/super-io.c:822
bch2_fs_open+0x3e5/0x1110 fs/bcachefs/super.c:2049
bch2_mount+0xdcc/0x1130 fs/bcachefs/fs.c:1903
legacy_get_tree+0x10c/0x220 fs/fs_context.c:662
vfs_get_tree+0x92/0x380 fs/super.c:1779
do_new_mount fs/namespace.c:3352 [inline]
path_mount+0x14e6/0x1f20 fs/namespace.c:3679
do_mount fs/namespace.c:3692 [inline]
__do_sys_mount fs/namespace.c:3898 [inline]
__se_sys_mount fs/namespace.c:3875 [inline]
__x64_sys_mount+0x297/0x320 fs/namespace.c:3875
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f688aa7f3aa
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:00007f688b756ef8 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f688b756f80 RCX: 00007f688aa7f3aa
RDX: 0000000020011a00 RSI: 0000000020000000 RDI: 00007f688b756f40
RBP: 0000000020011a00 R08: 00007f688b756f80 R09: 0000000003a04000
R10: 0000000003a04000 R11: 0000000000000202 R12: 0000000020000000
R13: 00007f688b756f40 R14: 0000000000011a04 R15: 0000000020000600
Allocated by task 9563:
kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
kasan_save_track+0x14/0x30 mm/kasan/common.c:68
poison_kmalloc_redzone mm/kasan/common.c:370 [inline]
__kasan_kmalloc+0xaa/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+0x220/0x470 mm/slub.c:3986
__do_krealloc mm/slab_common.c:1192 [inline]
krealloc+0x5d/0x100 mm/slab_common.c:1225
bch2_sb_realloc+0x242/0x5d0 fs/bcachefs/super-io.c:189
read_one_super+0x318/0x12a0 fs/bcachefs/super-io.c:659
__bch2_read_super+0x4d6/0x12a0 fs/bcachefs/super-io.c:750
bch2_fs_open+0x3e5/0x1110 fs/bcachefs/super.c:2049
bch2_mount+0xdcc/0x1130 fs/bcachefs/fs.c:1903
legacy_get_tree+0x10c/0x220 fs/fs_context.c:662
vfs_get_tree+0x92/0x380 fs/super.c:1779
do_new_mount fs/namespace.c:3352 [inline]
path_mount+0x14e6/0x1f20 fs/namespace.c:3679
do_mount fs/namespace.c:3692 [inline]
__do_sys_mount fs/namespace.c:3898 [inline]
__se_sys_mount fs/namespace.c:3875 [inline]
__x64_sys_mount+0x297/0x320 fs/namespace.c:3875
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
The buggy address belongs to the object at ffff88802d610000
which belongs to the cache kmalloc-8k of size 8192
The buggy address is located 16 bytes to the right of
allocated 8192-byte region [ffff88802d610000, ffff88802d612000)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2d610
head: order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
anon flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff888015042280 ffffea0001f36a00 dead000000000005
raw: 0000000000000000 0000000000020002 00000001ffffffff 0000000000000000
head: 00fff00000000840 ffff888015042280 ffffea0001f36a00 dead000000000005
head: 0000000000000000 0000000000020002 00000001ffffffff 0000000000000000
head: 00fff00000000003 ffffea0000b58401 ffffea0000b58448 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 0xd28c0(GFP_NOWAIT|__GFP_IO|__GFP_FS|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4750, tgid 672090073 (dhcpcd), ts 4750, free_ts 73594684350
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1534
prep_new_page mm/page_alloc.c:1541 [inline]
get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3317
__alloc_pages+0x22b/0x2460 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 mm/slub.c:2175 [inline]
allocate_slab mm/slub.c:2338 [inline]
new_slab+0xcc/0x3a0 mm/slub.c:2391
___slab_alloc+0x66d/0x1790 mm/slub.c:3525
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3610
__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_track_caller+0x367/0x470 mm/slub.c:3986
kmalloc_reserve+0xef/0x2c0 net/core/skbuff.c:599
__alloc_skb+0x164/0x380 net/core/skbuff.c:668
alloc_skb include/linux/skbuff.h:1313 [inline]
netlink_dump+0x2b2/0xe00 net/netlink/af_netlink.c:2229
netlink_recvmsg+0xa0d/0xf30 net/netlink/af_netlink.c:1987
sock_recvmsg_nosec net/socket.c:1046 [inline]
sock_recvmsg+0x1f9/0x250 net/socket.c:1068
____sys_recvmsg+0x21f/0x6b0 net/socket.c:2803
___sys_recvmsg+0x115/0x1a0 net/socket.c:2845
__sys_recvmsg+0x114/0x1e0 net/socket.c:2875
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
page last free pid 4850 tgid 4850 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+0x527/0xb10 mm/page_alloc.c:2347
free_unref_page+0x33/0x3c0 mm/page_alloc.c:2487
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x69/0x90 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]
kmem_cache_alloc+0x136/0x320 mm/slub.c:3852
getname_flags.part.0+0x50/0x4f0 fs/namei.c:139
getname_flags include/linux/audit.h:322 [inline]
getname+0x8f/0xe0 fs/namei.c:218
do_sys_openat2+0x104/0x1e0 fs/open.c:1400
do_sys_open fs/open.c:1421 [inline]
__do_sys_openat fs/open.c:1437 [inline]
__se_sys_openat fs/open.c:1432 [inline]
__x64_sys_openat+0x175/0x210 fs/open.c:1432
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Memory state around the buggy address:
ffff88802d611f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88802d611f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88802d612000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff88802d612080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88802d612100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
==================================================================
BUG: KASAN: slab-out-of-bounds in bch2_sb_downgrade_to_text+0x58d/0x680 fs/bcachefs/sb-downgrade.c:185
Read of size 2 at addr ffff88802d612012 by task syz-executor.3/9563
CPU: 0 PID: 9563 Comm: syz-executor.3 Tainted: G B 6.9.0-rc6-syzkaller-00290-gb9158815de52 #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+0x116/0x1f0 lib/dump_stack.c:114
print_address_description mm/kasan/report.c:377 [inline]
print_report+0xc3/0x620 mm/kasan/report.c:488
kasan_report+0xd9/0x110 mm/kasan/report.c:601
bch2_sb_downgrade_to_text+0x58d/0x680 fs/bcachefs/sb-downgrade.c:185
__bch2_sb_field_to_text+0x126/0x1e0 fs/bcachefs/super-io.c:1228
bch2_sb_field_validate+0x248/0x2d0 fs/bcachefs/super-io.c:1211
bch2_sb_validate.isra.0+0x6d8/0xce0 fs/bcachefs/super-io.c:468
__bch2_read_super+0x93c/0x12a0 fs/bcachefs/super-io.c:822
bch2_fs_open+0x3e5/0x1110 fs/bcachefs/super.c:2049
bch2_mount+0xdcc/0x1130 fs/bcachefs/fs.c:1903
legacy_get_tree+0x10c/0x220 fs/fs_context.c:662
vfs_get_tree+0x92/0x380 fs/super.c:1779
do_new_mount fs/namespace.c:3352 [inline]
path_mount+0x14e6/0x1f20 fs/namespace.c:3679
do_mount fs/namespace.c:3692 [inline]
__do_sys_mount fs/namespace.c:3898 [inline]
__se_sys_mount fs/namespace.c:3875 [inline]
__x64_sys_mount+0x297/0x320 fs/namespace.c:3875
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f688aa7f3aa
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:00007f688b756ef8 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f688b756f80 RCX: 00007f688aa7f3aa
RDX: 0000000020011a00 RSI: 0000000020000000 RDI: 00007f688b756f40
RBP: 0000000020011a00 R08: 00007f688b756f80 R09: 0000000003a04000
R10: 0000000003a04000 R11: 0000000000000202 R12: 0000000020000000
R13: 00007f688b756f40 R14: 0000000000011a04 R15: 0000000020000600
Allocated by task 9563:
kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
kasan_save_track+0x14/0x30 mm/kasan/common.c:68
poison_kmalloc_redzone mm/kasan/common.c:370 [inline]
__kasan_kmalloc+0xaa/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+0x220/0x470 mm/slub.c:3986
__do_krealloc mm/slab_common.c:1192 [inline]
krealloc+0x5d/0x100 mm/slab_common.c:1225
bch2_sb_realloc+0x242/0x5d0 fs/bcachefs/super-io.c:189
read_one_super+0x318/0x12a0 fs/bcachefs/super-io.c:659
__bch2_read_super+0x4d6/0x12a0 fs/bcachefs/super-io.c:750
bch2_fs_open+0x3e5/0x1110 fs/bcachefs/super.c:2049
bch2_mount+0xdcc/0x1130 fs/bcachefs/fs.c:1903
legacy_get_tree+0x10c/0x220 fs/fs_context.c:662
vfs_get_tree+0x92/0x380 fs/super.c:1779
do_new_mount fs/namespace.c:3352 [inline]
path_mount+0x14e6/0x1f20 fs/namespace.c:3679
do_mount fs/namespace.c:3692 [inline]
__do_sys_mount fs/namespace.c:3898 [inline]
__se_sys_mount fs/namespace.c:3875 [inline]
__x64_sys_mount+0x297/0x320 fs/namespace.c:3875
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
The buggy address belongs to the object at ffff88802d610000
which belongs to the cache kmalloc-8k of size 8192
The buggy address is located 18 bytes to the right of
allocated 8192-byte region [ffff88802d610000, ffff88802d612000)
The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2d610
head: order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
anon flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff888015042280 ffffea0001f36a00 dead000000000005
raw: 0000000000000000 0000000000020002 00000001ffffffff 0000000000000000
head: 00fff00000000840 ffff888015042280 ffffea0001f36a00 dead000000000005
head: 0000000000000000 0000000000020002 00000001ffffffff 0000000000000000
head: 00fff00000000003 ffffea0000b58401 ffffea0000b58448 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 0xd28c0(GFP_NOWAIT|__GFP_IO|__GFP_FS|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4750, tgid 672090073 (dhcpcd), ts 4750, free_ts 73594684350
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1534
prep_new_page mm/page_alloc.c:1541 [inline]
get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3317
__alloc_pages+0x22b/0x2460 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 mm/slub.c:2175 [inline]
allocate_slab mm/slub.c:2338 [inline]
new_slab+0xcc/0x3a0 mm/slub.c:2391
___slab_alloc+0x66d/0x1790 mm/slub.c:3525
__slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3610
__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_track_caller+0x367/0x470 mm/slub.c:3986
kmalloc_reserve+0xef/0x2c0 net/core/skbuff.c:599
__alloc_skb+0x164/0x380 net/core/skbuff.c:668
alloc_skb include/linux/skbuff.h:1313 [inline]
netlink_dump+0x2b2/0xe00 net/netlink/af_netlink.c:2229
netlink_recvmsg+0xa0d/0xf30 net/netlink/af_netlink.c:1987
sock_recvmsg_nosec net/socket.c:1046 [inline]
sock_recvmsg+0x1f9/0x250 net/socket.c:1068
____sys_recvmsg+0x21f/0x6b0 net/socket.c:2803
___sys_recvmsg+0x115/0x1a0 net/socket.c:2845
__sys_recvmsg+0x114/0x1e0 net/socket.c:2875
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x260 arch/x86/entry/common.c:83
page last free pid 4850 tgid 4850 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+0x527/0xb10 mm/page_alloc.c:2347
free_unref_page+0x33/0x3c0 mm/page_alloc.c:2487
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x69/0x90 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]
kmem_cache_alloc+0x136/0x320 mm/slub.c:3852
getname_flags.part.0+0x50/0x4f0 fs/namei.c:139
getname_flags include/linux/audit.h:322 [inline]
getname+0x8f/0xe0 fs/namei.c:218