syzbot


KASAN: slab-out-of-bounds Read in ea_get

Status: upstream: reported C repro on 2023/06/02 15:16
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+f0b9c081e1661c706b16@syzkaller.appspotmail.com
First crash: 382d, last: 17d
Bug presence (1)
Date Name Commit Repro Result
2024/01/26 upstream (ToT) ecb1b8288dc7 C [report] KASAN: slab-out-of-bounds Read in ea_get
Similar bugs (5)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 KASAN: slab-out-of-bounds Read in ea_get 3 590d 623d 0/1 auto-obsoleted due to no activity on 2023/03/06 17:23
linux-5.15 KASAN: slab-out-of-bounds Read in ea_get origin:upstream C error 18 47d 383d 0/3 upstream: reported C repro on 2023/06/01 07:39
upstream KASAN: slab-out-of-bounds Read in ea_get (2) jfs C 10 16d 46d 14/27 upstream: reported C repro on 2024/05/03 18:51
linux-4.14 KASAN: slab-out-of-bounds Read in ea_get C 1 482d 621d 0/1 upstream: reported C repro on 2022/10/07 03:56
upstream KASAN: slab-out-of-bounds Read in ea_get jfs C inconclusive 29 246d 623d 0/27 closed as dup on 2022/10/05 09:10
Fix bisection attempts (9)
Created Duration User Patch Repo Result
2024/06/01 16:26 1h39m bisect fix linux-6.1.y job log (0) log
2024/04/04 05:50 1h40m bisect fix linux-6.1.y job log (0) log
2024/03/04 17:38 1h16m bisect fix linux-6.1.y job log (0) log
2024/01/26 13:56 1h12m bisect fix linux-6.1.y job log (0) log
2023/12/26 06:33 1h26m bisect fix linux-6.1.y job log (0) log
2023/11/26 01:18 1h24m bisect fix linux-6.1.y job log (0) log
2023/10/24 05:22 1h24m bisect fix linux-6.1.y job log (0) log
2023/09/18 23:33 1h42m bisect fix linux-6.1.y job log (0) log
2023/07/05 02:56 4h07m bisect fix linux-6.1.y job log (0) log

Sample crash report:
ffff888074143fd0: 00 00 00 00 00 00 00 00 20 49 f9 8a ff ff ff ff  ........ I......
ffff888074143fe0: 00 02 00 00 00 00 00 00 e8 3f 14 74 80 88 ff ff  .........?.t....
ffff888074143ff0: e8 3f 14 74 80 88 ff ff 00 00 00 00 00 00 00 00  .?.t............
ffff888074144000: 00 40 14 74 80 88 ff ff 00 40 14 74 80 88 ff ff  .@.t.....@.t....
ffff888074144010: 00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00  ................
ffff888074144020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
ffff888074144030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
==================================================================
BUG: KASAN: slab-out-of-bounds in hex_dump_to_buffer+0x72d/0xba0 lib/hexdump.c:193
Read of size 1 at addr ffff888074144040 by task syz-executor323/3545

CPU: 0 PID: 3545 Comm: syz-executor323 Not tainted 6.1.38-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/03/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:284 [inline]
 print_report+0x15f/0x4f0 mm/kasan/report.c:395
 kasan_report+0x136/0x160 mm/kasan/report.c:495
 hex_dump_to_buffer+0x72d/0xba0 lib/hexdump.c:193
 print_hex_dump+0x13b/0x250 lib/hexdump.c:276
 ea_get+0xcdc/0x1280 fs/jfs/xattr.c:561
 jfs_listxattr+0xe0/0x810 fs/jfs/xattr.c:867
 vfs_listxattr fs/xattr.c:457 [inline]
 listxattr+0x282/0x2e0 fs/xattr.c:804
 path_listxattr fs/xattr.c:828 [inline]
 __do_sys_listxattr fs/xattr.c:840 [inline]
 __se_sys_listxattr fs/xattr.c:837 [inline]
 __x64_sys_listxattr+0x172/0x230 fs/xattr.c:837
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f77ea2ad4a9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 14 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 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:00007fff13327898 EFLAGS: 00000246 ORIG_RAX: 00000000000000c2
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f77ea2ad4a9
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000000
RBP: 0000000000000000 R08: 0000000000000002 R09: 00007f77ea320ec0
R10: 00007fff13327760 R11: 0000000000000246 R12: 00007fff133278c0
R13: 0000000000000000 R14: 431bde82d7b634db R15: 0000000000000000
 </TASK>

Allocated by task 3545:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
 __kasan_slab_alloc+0x65/0x70 mm/kasan/common.c:328
 kasan_slab_alloc include/linux/kasan.h:201 [inline]
 slab_post_alloc_hook+0x50/0x370 mm/slab.h:737
 slab_alloc_node mm/slub.c:3398 [inline]
 slab_alloc mm/slub.c:3406 [inline]
 __kmem_cache_alloc_lru mm/slub.c:3413 [inline]
 kmem_cache_alloc_lru+0x10c/0x2d0 mm/slub.c:3429
 alloc_inode_sb include/linux/fs.h:3131 [inline]
 jfs_alloc_inode+0x24/0x60 fs/jfs/super.c:105
 alloc_inode fs/inode.c:259 [inline]
 iget_locked+0x1c8/0x830 fs/inode.c:1286
 jfs_iget+0x1e/0x3b0 fs/jfs/inode.c:29
 jfs_lookup+0x222/0x400 fs/jfs/namei.c:1462
 __lookup_slow+0x27e/0x3d0 fs/namei.c:1685
 lookup_slow+0x53/0x70 fs/namei.c:1702
 walk_component+0x2d0/0x400 fs/namei.c:1993
 lookup_last fs/namei.c:2450 [inline]
 path_lookupat+0x16f/0x450 fs/namei.c:2474
 filename_lookup+0x251/0x600 fs/namei.c:2503
 user_path_at_empty+0x40/0x180 fs/namei.c:2876
 user_path_at include/linux/namei.h:57 [inline]
 path_listxattr fs/xattr.c:825 [inline]
 __do_sys_listxattr fs/xattr.c:840 [inline]
 __se_sys_listxattr fs/xattr.c:837 [inline]
 __x64_sys_listxattr+0x108/0x230 fs/xattr.c:837
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

The buggy address belongs to the object at ffff888074143780
 which belongs to the cache jfs_ip of size 2240
The buggy address is located 0 bytes to the right of
 2240-byte region [ffff888074143780, ffff888074144040)

The buggy address belongs to the physical page:
page:ffffea0001d05000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x74140
head:ffffea0001d05000 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 0000000000000000 dead000000000122 ffff88814668d640
raw: 0000000000000000 00000000800d000d 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Reclaimable, gfp_mask 0xd2050(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_RECLAIMABLE), pid 3545, tgid 3545 (syz-executor323), ts 67407558882, free_ts 17324886852
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2533
 prep_new_page mm/page_alloc.c:2540 [inline]
 get_page_from_freelist+0x32ed/0x3480 mm/page_alloc.c:4292
 __alloc_pages+0x28d/0x770 mm/page_alloc.c:5559
 alloc_slab_page+0x6a/0x150 mm/slub.c:1794
 allocate_slab mm/slub.c:1939 [inline]
 new_slab+0x84/0x2d0 mm/slub.c:1992
 ___slab_alloc+0xa71/0x1080 mm/slub.c:3180
 __slab_alloc mm/slub.c:3279 [inline]
 slab_alloc_node mm/slub.c:3364 [inline]
 slab_alloc mm/slub.c:3406 [inline]
 __kmem_cache_alloc_lru mm/slub.c:3413 [inline]
 kmem_cache_alloc_lru+0x1a5/0x2d0 mm/slub.c:3429
 alloc_inode_sb include/linux/fs.h:3131 [inline]
 jfs_alloc_inode+0x24/0x60 fs/jfs/super.c:105
 alloc_inode fs/inode.c:259 [inline]
 new_inode_pseudo+0x61/0x1d0 fs/inode.c:1018
 new_inode+0x25/0x1d0 fs/inode.c:1046
 jfs_fill_super+0x404/0xc40 fs/jfs/super.c:544
 mount_bdev+0x2c9/0x3f0 fs/super.c:1423
 legacy_get_tree+0xeb/0x180 fs/fs_context.c:610
 vfs_get_tree+0x88/0x270 fs/super.c:1553
 do_new_mount+0x28b/0xae0 fs/namespace.c:3040
 do_mount fs/namespace.c:3383 [inline]
 __do_sys_mount fs/namespace.c:3591 [inline]
 __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3568
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1460 [inline]
 free_pcp_prepare mm/page_alloc.c:1510 [inline]
 free_unref_page_prepare+0xf63/0x1120 mm/page_alloc.c:3388
 free_unref_page+0x98/0x570 mm/page_alloc.c:3484
 free_contig_range+0x9a/0x150 mm/page_alloc.c:9519
 destroy_args+0xfe/0x997 mm/debug_vm_pgtable.c:1031
 debug_vm_pgtable+0x416/0x46b mm/debug_vm_pgtable.c:1354
 do_one_initcall+0x265/0x8f0 init/main.c:1303
 do_initcall_level+0x157/0x207 init/main.c:1376
 do_initcalls+0x49/0x86 init/main.c:1392
 kernel_init_freeable+0x473/0x61f init/main.c:1631
 kernel_init+0x19/0x290 init/main.c:1519
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306

Memory state around the buggy address:
 ffff888074143f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff888074143f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff888074144000: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
                                           ^
 ffff888074144080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888074144100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/07/09 01:00 linux-6.1.y 61fd484b2cf6 668cb1fa .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan KASAN: slab-out-of-bounds Read in ea_get
2024/04/29 19:40 linux-6.1.y dcbc050cb0d3 27e33c58 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 KASAN: slab-out-of-bounds Read in ea_get
2023/06/02 15:15 linux-6.1.y d2869ace6eeb a4ae4f42 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 KASAN: slab-out-of-bounds Read in ea_get
2024/04/29 18:49 linux-6.1.y dcbc050cb0d3 27e33c58 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: slab-out-of-bounds Read in ea_get
2024/04/29 18:44 linux-6.1.y dcbc050cb0d3 27e33c58 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: slab-out-of-bounds Read in ea_get
* Struck through repros no longer work on HEAD.