syzbot


KASAN: out-of-bounds Read in leaf_paste_entries (2)

Status: upstream: reported C repro on 2021/12/13 19:20
Reported-by: syzbot+38b79774b6c990637f95@syzkaller.appspotmail.com
First crash: 451d, last: 21h45m

Cause bisection: the issue happens on the oldest tested release (bisect log)
Crash: KASAN: out-of-bounds Read in leaf_paste_entries (log)
Repro: C syz .config

Fix bisection: the fix commit could be any of (bisect log):
  2585cf9dfaad Linux 5.16-rc5
  1612c382ffbd Merge tag 'x86-urgent-2022-08-06' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
similar bugs (5):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 KASAN: out-of-bounds Read in leaf_paste_entries reiserfs C error 49 2d14h 813d 0/1 upstream: reported C repro on 2020/11/14 23:23
linux-4.14 KASAN: out-of-bounds Read in leaf_paste_entries reiserfs C error 13 42d 854d 0/1 upstream: reported C repro on 2020/10/05 14:11
upstream KASAN: out-of-bounds Read in leaf_paste_entries C inconclusive 8 485d 716d 22/24 fixed on 2021/11/10 00:50
linux-4.14 KASAN: use-after-free Read in leaf_paste_entries C done 6 772d 816d 1/1 fixed on 2021/01/26 16:42
linux-4.19 KASAN: use-after-free Read in leaf_paste_entries C done 1 779d 779d 1/1 fixed on 2021/01/19 18:33

Sample crash report:
REISERFS warning:  read_super_block: reiserfs filesystem is deprecated and scheduled to be removed from the kernel in 2025
REISERFS (device loop0): found reiserfs format "3.6" with non-standard journal
REISERFS (device loop0): using ordered data mode
reiserfs: using flush barriers
REISERFS (device loop0): journal params: device loop0, size 512, journal first block 18, max trans len 256, max batch 225, max commit age 30, max trans age 30
REISERFS (device loop0): checking transaction log (loop0)
REISERFS (device loop0): Using rupasov hash to sort names
==================================================================
BUG: KASAN: out-of-bounds in leaf_paste_entries+0x449/0x910 fs/reiserfs/lbalance.c:1377
Read of size 18446744073709551584 at addr ffff88807c9e4fa4 by task syz-executor262/3604

CPU: 1 PID: 3604 Comm: syz-executor262 Not tainted 6.0.0-syzkaller-09589-g55be6084c8e0 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:317 [inline]
 print_report.cold+0x2ba/0x719 mm/kasan/report.c:433
 kasan_report+0xb1/0x1e0 mm/kasan/report.c:495
 check_region_inline mm/kasan/generic.c:183 [inline]
 kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189
 memmove+0x20/0x60 mm/kasan/shadow.c:54
 leaf_paste_entries+0x449/0x910 fs/reiserfs/lbalance.c:1377
 balance_leaf_finish_node_paste_dirent fs/reiserfs/do_balan.c:1295 [inline]
 balance_leaf_finish_node_paste fs/reiserfs/do_balan.c:1321 [inline]
 balance_leaf_finish_node fs/reiserfs/do_balan.c:1364 [inline]
 balance_leaf+0x917d/0xde40 fs/reiserfs/do_balan.c:1452
 do_balance+0x315/0x810 fs/reiserfs/do_balan.c:1888
 reiserfs_paste_into_item+0x763/0x8e0 fs/reiserfs/stree.c:2159
 reiserfs_add_entry+0x8cb/0xcf0 fs/reiserfs/namei.c:567
 reiserfs_mkdir+0x675/0x980 fs/reiserfs/namei.c:860
 xattr_mkdir fs/reiserfs/xattr.c:76 [inline]
 create_privroot fs/reiserfs/xattr.c:882 [inline]
 reiserfs_xattr_init+0x57a/0xc30 fs/reiserfs/xattr.c:1005
 reiserfs_fill_super+0x21d7/0x2f80 fs/reiserfs/super.c:2177
 mount_bdev+0x34d/0x410 fs/super.c:1400
 legacy_get_tree+0x105/0x220 fs/fs_context.c:610
 vfs_get_tree+0x89/0x2f0 fs/super.c:1530
 do_new_mount fs/namespace.c:3040 [inline]
 path_mount+0x1326/0x1e20 fs/namespace.c:3370
 do_mount fs/namespace.c:3383 [inline]
 __do_sys_mount fs/namespace.c:3591 [inline]
 __se_sys_mount fs/namespace.c:3568 [inline]
 __x64_sys_mount+0x27f/0x300 fs/namespace.c:3568
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f285d4e035a
Code: 83 c4 08 5b 5d c3 66 2e 0f 1f 84 00 00 00 00 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fff8a91f0d8 EFLAGS: 00000286 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f285d4e035a
RDX: 0000000020000000 RSI: 0000000020000180 RDI: 00007fff8a91f0f0
RBP: 00007fff8a91f0f0 R08: 00007fff8a91f130 R09: 0000555556cbb2c0
R10: 0000000000000000 R11: 0000000000000286 R12: 0000000000000004
R13: 00007fff8a91f130 R14: 0000000000000006 R15: 0000000020000290
 </TASK>

The buggy address belongs to the physical page:
page:ffffea0001f27900 refcount:3 mapcount:0 mapping:ffff888140daeaf8 index:0x213 pfn:0x7c9e4
memcg:ffff888140188000
aops:def_blk_aops ino:700000
flags: 0xfff00000002022(referenced|active|private|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000002022 0000000000000000 dead000000000122 ffff888140daeaf8
raw: 0000000000000213 ffff8880700251d0 00000003ffffffff ffff888140188000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Movable, gfp_mask 0x148c48(GFP_NOFS|__GFP_NOFAIL|__GFP_COMP|__GFP_HARDWALL|__GFP_MOVABLE), pid 3604, tgid 3604 (syz-executor262), ts 40065573836, free_ts 40040802854
 prep_new_page mm/page_alloc.c:2532 [inline]
 get_page_from_freelist+0x109b/0x2ce0 mm/page_alloc.c:4283
 __alloc_pages+0x1c7/0x510 mm/page_alloc.c:5549
 alloc_pages+0x1a6/0x270 mm/mempolicy.c:2270
 folio_alloc+0x1c/0x70 mm/mempolicy.c:2280
 filemap_alloc_folio+0x306/0x3a0 mm/filemap.c:970
 __filemap_get_folio+0x328/0xed0 mm/filemap.c:1970
 pagecache_get_page+0x2e/0x290 mm/folio-compat.c:104
 find_or_create_page include/linux/pagemap.h:613 [inline]
 grow_dev_page fs/buffer.c:946 [inline]
 grow_buffers fs/buffer.c:1011 [inline]
 __getblk_slow+0x1f4/0x1030 fs/buffer.c:1038
 __getblk_gfp+0x6e/0x80 fs/buffer.c:1333
 sb_getblk include/linux/buffer_head.h:363 [inline]
 search_by_key+0x3a8/0x3bc0 fs/reiserfs/stree.c:672
 reiserfs_read_locked_inode+0x154/0x2160 fs/reiserfs/inode.c:1549
 reiserfs_fill_super+0x1616/0x2f80 fs/reiserfs/super.c:2073
 mount_bdev+0x34d/0x410 fs/super.c:1400
 legacy_get_tree+0x105/0x220 fs/fs_context.c:610
 vfs_get_tree+0x89/0x2f0 fs/super.c:1530
 do_new_mount fs/namespace.c:3040 [inline]
 path_mount+0x1326/0x1e20 fs/namespace.c:3370
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1449 [inline]
 free_pcp_prepare+0x5e4/0xd20 mm/page_alloc.c:1499
 free_unref_page_prepare mm/page_alloc.c:3380 [inline]
 free_unref_page_list+0x16f/0xb90 mm/page_alloc.c:3522
 release_pages+0xbd3/0x1400 mm/swap.c:1012
 folios_put include/linux/mm.h:1164 [inline]
 folio_batch_move_lru+0x2b7/0x440 mm/swap.c:253
 folio_batch_add_and_move+0xd4/0x130 mm/swap.c:263
 folio_add_lru+0x26e/0x680 mm/swap.c:490
 filemap_add_folio+0x133/0x1d0 mm/filemap.c:948
 __filemap_get_folio+0x385/0xed0 mm/filemap.c:1981
 pagecache_get_page+0x2e/0x290 mm/folio-compat.c:104
 find_or_create_page include/linux/pagemap.h:613 [inline]
 grow_dev_page fs/buffer.c:946 [inline]
 grow_buffers fs/buffer.c:1011 [inline]
 __getblk_slow+0x1f4/0x1030 fs/buffer.c:1038
 __getblk_gfp fs/buffer.c:1333 [inline]
 __bread_gfp+0x228/0x320 fs/buffer.c:1378
 __bread include/linux/buffer_head.h:434 [inline]
 journal_init+0xd9a/0x64c0 fs/reiserfs/journal.c:2787
 reiserfs_fill_super+0xc57/0x2f80 fs/reiserfs/super.c:2024
 mount_bdev+0x34d/0x410 fs/super.c:1400
 legacy_get_tree+0x105/0x220 fs/fs_context.c:610
 vfs_get_tree+0x89/0x2f0 fs/super.c:1530

Memory state around the buggy address:
 ffff88807c9e4e80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff88807c9e4f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88807c9e4f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                               ^
 ffff88807c9e5000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff88807c9e5080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Crashes (147):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets Title
ci-upstream-kasan-gce-root 2022/10/15 11:31 upstream 55be6084c8e0 67cb024c .config strace log report syz C [disk image] [vmlinux] [mounted in repro] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2022/10/08 17:28 upstream 62e6e5940c0c aea5da89 .config strace log report syz C [disk image] [vmlinux] [mounted in repro] KASAN: out-of-bounds Read in leaf_paste_entries
ci-upstream-kasan-gce-root 2022/10/01 01:31 upstream 5a77386984b5 feb56351 .config strace log report syz C [disk image] [vmlinux] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2022/09/26 06:55 upstream 105a36f3694e 0042f2b4 .config strace log report syz C [disk image] [vmlinux] KASAN: out-of-bounds Read in leaf_paste_entries
ci-upstream-kasan-gce-selinux-root 2021/12/13 19:20 upstream 2585cf9dfaad 49ca1f59 .config console log report syz C KASAN: out-of-bounds Read in leaf_paste_entries
ci-upstream-linux-next-kasan-gce-root 2022/10/27 14:28 linux-next 4d48f589d294 86777b7f .config strace log report syz C [disk image] [vmlinux] [mounted in repro] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/02/05 22:05 upstream 837c07cf68fe be607b78 .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci-upstream-kasan-gce-root 2023/02/04 23:56 upstream 0136d86b7852 be607b78 .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/02/04 10:43 upstream 0136d86b7852 1b2f701a .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/02/03 18:52 upstream 66a87fff1a87 1b2f701a .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/02/01 16:06 upstream c0b67534c95c 9a6f477c .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/02/01 02:53 upstream 22b8077d0fce b68fb8d6 .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/01/31 17:35 upstream 22b8077d0fce b68fb8d6 .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/01/30 16:07 upstream 6d796c50f84c b68fb8d6 .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/01/30 01:01 upstream ab072681eabe 9dfcf09c .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/01/28 10:56 upstream 83abd4d4c4be 9dfcf09c .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/01/28 07:41 upstream 83abd4d4c4be 9dfcf09c .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/01/27 10:45 upstream 7c46948a6e9c 9dfcf09c .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/01/27 06:52 upstream 7c46948a6e9c 9dfcf09c .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/01/26 13:10 upstream 7c46948a6e9c 9dfcf09c .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/01/25 15:52 upstream 948ef7bb70c4 9dfcf09c .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/01/24 21:26 upstream 7bf70dbb1882 9dfcf09c .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/01/24 04:21 upstream 7bf70dbb1882 9dfcf09c .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/01/23 06:10 upstream 2475bf0250de cc0f9968 .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/01/22 20:07 upstream 2241ab53cbb5 cc0f9968 .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/01/22 12:16 upstream 2241ab53cbb5 cc0f9968 .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci-upstream-kasan-gce-selinux-root 2023/01/21 23:09 upstream f883675bf652 559a440a .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/01/21 04:06 upstream edc00350d205 cc0f9968 .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/01/20 16:30 upstream d368967cb103 dd15ff29 .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/01/18 21:22 upstream c1649ec55708 4620c2d9 .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci-upstream-kasan-gce-root 2023/01/18 18:10 upstream c1649ec55708 42660d9e .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/01/14 20:45 upstream 97ec4d559d93 a63719e7 .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/01/14 01:28 upstream d9fc1511728c 529798b0 .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci-upstream-kasan-gce-root 2023/01/13 23:37 upstream d9fc1511728c 529798b0 .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/01/13 08:56 upstream c757fc92a3f7 96166539 .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/01/12 20:10 upstream e8f60cd7db24 96166539 .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci-upstream-kasan-gce-root 2023/01/12 00:33 upstream 7dd4b804e080 96166539 .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/01/10 19:09 upstream 5a41237ad1d4 48bc529a .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/01/10 17:36 upstream 5a41237ad1d4 48bc529a .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci-upstream-kasan-gce-selinux-root 2023/01/09 20:02 upstream 1fe4fd6f5cad 1dac8c7a .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/01/09 07:30 upstream 1fe4fd6f5cad 1dac8c7a .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/01/08 22:09 upstream 9b43a525db12 1dac8c7a .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/01/07 16:39 upstream 0a71553536d2 1dac8c7a .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/01/07 10:53 upstream 1f5abbd77e2c 1dac8c7a .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/01/06 21:24 upstream 1f5abbd77e2c 1dac8c7a .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/01/05 20:07 upstream 512dee0c00ad 1dac8c7a .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/01/05 04:12 upstream 69b41ac87e4a 1dac8c7a .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/01/04 16:00 upstream 69b41ac87e4a 1dac8c7a .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/01/03 20:46 upstream 69b41ac87e4a f0036e18 .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/01/02 23:43 upstream 88603b6dc419 ab32d508 .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/01/01 20:50 upstream e4cf7c25bae5 ab32d508 .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci-qemu-upstream 2022/12/22 04:57 upstream 7c0846125358 4067838e .config console log report info KASAN: out-of-bounds Read in leaf_paste_entries
ci-qemu-upstream-386 2023/01/06 09:37 upstream 1f5abbd77e2c 1dac8c7a .config console log report info KASAN: out-of-bounds Read in leaf_paste_entries
ci-qemu-upstream-386 2021/11/12 06:32 upstream 5833291ab6de 75b04091 .config console log report info KASAN: out-of-bounds Read in leaf_paste_entries
ci-upstream-linux-next-kasan-gce-root 2023/01/13 12:40 linux-next 0a093b2893c7 96166539 .config console log report info [disk image] [vmlinux] [kernel image] KASAN: out-of-bounds Read in leaf_paste_entries
ci2-upstream-fs 2023/02/04 06:47 upstream 0136d86b7852 1b2f701a .config console log report info [disk image] [vmlinux] [kernel image] KASAN: use-after-free Read in leaf_paste_entries
ci2-upstream-fs 2023/02/01 17:15 upstream c0b67534c95c 9a6f477c .config console log report info [disk image] [vmlinux] [kernel image] KASAN: use-after-free Read in leaf_paste_entries
ci2-upstream-fs 2023/01/30 12:20 upstream 6d796c50f84c b68fb8d6 .config console log report info [disk image] [vmlinux] [kernel image] KASAN: use-after-free Read in leaf_paste_entries
ci2-upstream-fs 2023/01/30 07:36 upstream ab072681eabe 9dfcf09c .config console log report info [disk image] [vmlinux] [kernel image] KASAN: use-after-free Read in leaf_paste_entries
ci2-upstream-fs 2023/01/29 16:51 upstream c96618275234 9dfcf09c .config console log report info [disk image] [vmlinux] [kernel image] KASAN: use-after-free Read in leaf_paste_entries
ci2-upstream-fs 2023/01/25 23:38 upstream 948ef7bb70c4 9dfcf09c .config console log report info [disk image] [vmlinux] [kernel image] KASAN: use-after-free Read in leaf_paste_entries
* Struck through repros no longer work on HEAD.