syzbot


KASAN: invalid-free in hfs_release_folio

Status: auto-obsoleted due to no activity on 2023/12/04 08:11
Subsystems: hfs
[Documentation on labels]
Reported-by: syzbot+9cfc27352679b68259f8@syzkaller.appspotmail.com
First crash: 619d, last: 440d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [hfs?] KASAN: invalid-free in hfs_release_folio 0 (1) 2023/03/04 08:49
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: invalid-free in hfs_release_folio (2) hfs 4 176d 277d 0/28 auto-obsoleted due to no activity on 2024/08/24 13:29

Sample crash report:
==================================================================
BUG: KASAN: double-free in hfs_release_folio+0x462/0x570 fs/hfs/inode.c:123
Free of addr ffff888015666000 by task kswapd0/110

CPU: 1 PID: 110 Comm: kswapd0 Not tainted 6.3.0-rc6-syzkaller-00034-ge62252bc55b6 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106
 print_address_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:319
 print_report mm/kasan/report.c:430 [inline]
 kasan_report_invalid_free+0xe8/0x100 mm/kasan/report.c:501
 ____kasan_slab_free+0x160/0x1a0 mm/kasan/common.c:225
 kasan_slab_free include/linux/kasan.h:162 [inline]
 __cache_free mm/slab.c:3390 [inline]
 __do_kmem_cache_free mm/slab.c:3577 [inline]
 __kmem_cache_free+0xcd/0x2c0 mm/slab.c:3584
 hfs_release_folio+0x462/0x570 fs/hfs/inode.c:123
 filemap_release_folio+0x13f/0x1b0 mm/filemap.c:4121
 shrink_folio_list+0x1fe3/0x3c80 mm/vmscan.c:2010
 evict_folios+0x794/0x1940 mm/vmscan.c:5121
 try_to_shrink_lruvec+0x82c/0xb90 mm/vmscan.c:5297
 shrink_one+0x46b/0x810 mm/vmscan.c:5341
 shrink_many mm/vmscan.c:5394 [inline]
 lru_gen_shrink_node mm/vmscan.c:5511 [inline]
 shrink_node+0x2064/0x35f0 mm/vmscan.c:6459
 kswapd_shrink_node mm/vmscan.c:7262 [inline]
 balance_pgdat+0xa02/0x1ac0 mm/vmscan.c:7452
 kswapd+0x677/0xd60 mm/vmscan.c:7712
 kthread+0x2e8/0x3a0 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
 </TASK>

Allocated by task 16592:
 kasan_save_stack+0x22/0x40 mm/kasan/common.c:45
 kasan_set_track+0x25/0x30 mm/kasan/common.c:52
 ____kasan_kmalloc mm/kasan/common.c:374 [inline]
 ____kasan_kmalloc mm/kasan/common.c:333 [inline]
 __kasan_kmalloc+0xa3/0xb0 mm/kasan/common.c:383
 kasan_kmalloc include/linux/kasan.h:196 [inline]
 __do_kmalloc_node mm/slab_common.c:967 [inline]
 __kmalloc+0x5e/0x190 mm/slab_common.c:980
 kmalloc include/linux/slab.h:584 [inline]
 kzalloc include/linux/slab.h:720 [inline]
 __hfs_bnode_create+0x107/0x820 fs/hfs/bnode.c:259
 hfs_bnode_find+0x423/0xc60 fs/hfs/bnode.c:335
 hfs_brec_find+0x299/0x500 fs/hfs/bfind.c:126
 hfs_brec_read+0x25/0x120 fs/hfs/bfind.c:165
 hfs_cat_find_brec+0x143/0x350 fs/hfs/catalog.c:194
 hfs_fill_super+0xfbd/0x1480 fs/hfs/super.c:419
 mount_bdev+0x351/0x410 fs/super.c:1380
 legacy_get_tree+0x109/0x220 fs/fs_context.c:610
 vfs_get_tree+0x8d/0x350 fs/super.c:1510
 do_new_mount fs/namespace.c:3042 [inline]
 path_mount+0x1342/0x1e40 fs/namespace.c:3372
 do_mount fs/namespace.c:3385 [inline]
 __do_sys_mount fs/namespace.c:3594 [inline]
 __se_sys_mount fs/namespace.c:3571 [inline]
 __x64_sys_mount+0x283/0x300 fs/namespace.c:3571
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Freed by task 16592:
 kasan_save_stack+0x22/0x40 mm/kasan/common.c:45
 kasan_set_track+0x25/0x30 mm/kasan/common.c:52
 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:521
 ____kasan_slab_free mm/kasan/common.c:236 [inline]
 ____kasan_slab_free+0x13b/0x1a0 mm/kasan/common.c:200
 kasan_slab_free include/linux/kasan.h:162 [inline]
 __cache_free mm/slab.c:3390 [inline]
 __do_kmem_cache_free mm/slab.c:3577 [inline]
 __kmem_cache_free+0xcd/0x2c0 mm/slab.c:3584
 hfs_btree_close+0xab/0x390 fs/hfs/btree.c:154
 hfs_mdb_put+0xbf/0x380 fs/hfs/mdb.c:360
 hfs_fill_super+0xa71/0x1480 fs/hfs/super.c:449
 mount_bdev+0x351/0x410 fs/super.c:1380
 legacy_get_tree+0x109/0x220 fs/fs_context.c:610
 vfs_get_tree+0x8d/0x350 fs/super.c:1510
 do_new_mount fs/namespace.c:3042 [inline]
 path_mount+0x1342/0x1e40 fs/namespace.c:3372
 do_mount fs/namespace.c:3385 [inline]
 __do_sys_mount fs/namespace.c:3594 [inline]
 __se_sys_mount fs/namespace.c:3571 [inline]
 __x64_sys_mount+0x283/0x300 fs/namespace.c:3571
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

The buggy address belongs to the object at ffff888015666000
 which belongs to the cache kmalloc-192 of size 192
The buggy address is located 0 bytes inside of
 192-byte region [ffff888015666000, ffff8880156660c0)

The buggy address belongs to the physical page:
page:ffffea0000559980 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x15666
flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000200 ffff888012440000 ffffea0000517590 ffffea000055ca90
raw: 0000000000000000 ffff888015666000 0000000100000010 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x2420c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_COMP|__GFP_THISNODE), pid 1, tgid 1 (swapper/0), ts 4893456499, free_ts 0
 prep_new_page mm/page_alloc.c:2553 [inline]
 get_page_from_freelist+0x1190/0x2e20 mm/page_alloc.c:4326
 __alloc_pages+0x1cb/0x4a0 mm/page_alloc.c:5592
 __alloc_pages_node include/linux/gfp.h:237 [inline]
 kmem_getpages mm/slab.c:1360 [inline]
 cache_grow_begin+0x9b/0x3b0 mm/slab.c:2570
 cache_alloc_refill+0x27f/0x380 mm/slab.c:2943
 ____cache_alloc mm/slab.c:3019 [inline]
 ____cache_alloc mm/slab.c:3002 [inline]
 __do_cache_alloc mm/slab.c:3202 [inline]
 slab_alloc_node mm/slab.c:3250 [inline]
 __kmem_cache_alloc_node+0x360/0x3f0 mm/slab.c:3541
 kmalloc_trace+0x26/0xe0 mm/slab_common.c:1061
 kmalloc include/linux/slab.h:580 [inline]
 kzalloc include/linux/slab.h:720 [inline]
 call_usermodehelper_setup+0x9c/0x340 kernel/umh.c:363
 kobject_uevent_env+0xedd/0x16c0 lib/kobject_uevent.c:614
 workqueue_sysfs_register+0x2d8/0x3f0 kernel/workqueue.c:5910
 alloc_workqueue+0x637/0x1110 kernel/workqueue.c:4465
 default_bdi_init+0x1e/0x40 mm/backing-dev.c:363
 do_one_initcall+0x102/0x540 init/main.c:1310
 do_initcall_level init/main.c:1383 [inline]
 do_initcalls init/main.c:1399 [inline]
 do_basic_setup init/main.c:1418 [inline]
 kernel_init_freeable+0x696/0xc00 init/main.c:1638
 kernel_init+0x1e/0x2c0 init/main.c:1526
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
page_owner free stack trace missing

Memory state around the buggy address:
 ffff888015665f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc
 ffff888015665f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888015666000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                   ^
 ffff888015666080: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
 ffff888015666100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Crashes (13):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/04/12 14:36 upstream e62252bc55b6 1a1596b6 .config console log report info ci-qemu-upstream KASAN: invalid-free in hfs_release_folio
2023/04/07 06:42 upstream f2afccfefe7b 00ce4c67 .config console log report info ci-qemu-upstream KASAN: invalid-free in hfs_release_folio
2023/08/26 08:10 upstream 7d2f353b2682 7ba13a15 .config console log report info ci-qemu-upstream-386 KASAN: invalid-free in hfs_release_folio
2023/08/22 08:17 upstream f7757129e3de 6b415825 .config console log report info ci-qemu-upstream-386 KASAN: invalid-free in hfs_release_folio
2023/08/07 15:36 upstream 52a93d39b17d 0ef3dfda .config console log report info ci-qemu-upstream-386 KASAN: invalid-free in hfs_release_folio
2023/06/16 04:07 upstream b6dad5178cea f3921d4d .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 KASAN: invalid-free in hfs_release_folio
2023/06/15 11:45 upstream b6dad5178cea ee64538c .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 KASAN: invalid-free in hfs_release_folio
2023/05/22 01:19 upstream e2065b8c1b01 4bce1a3e .config console log report info ci-qemu-upstream-386 KASAN: invalid-free in hfs_release_folio
2023/05/11 15:11 upstream 80e62bc8487b 0fbd49f4 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 KASAN: invalid-free in hfs_release_folio
2023/05/03 04:43 upstream 7df047b3f0aa 48e0a81d .config console log report info ci-qemu-upstream-386 KASAN: invalid-free in hfs_release_folio
2023/04/26 06:58 upstream 4173cf6fb6b7 7560799c .config console log report info ci-qemu-upstream-386 KASAN: invalid-free in hfs_release_folio
2023/04/24 08:30 upstream 457391b03803 2b32bd34 .config console log report info ci-qemu-upstream-386 KASAN: invalid-free in hfs_release_folio
2023/02/28 08:38 upstream 982818426a0f 95aee97a .config console log report info ci-qemu-upstream-386 KASAN: invalid-free in hfs_release_folio
* Struck through repros no longer work on HEAD.