syzbot


KASAN: use-after-free Read in release_metapage

Status: auto-obsoleted due to no activity on 2023/03/09 00:53
Reported-by: syzbot+0bb1a4379ad8e4440737@syzkaller.appspotmail.com
First crash: 526d, last: 526d
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in release_metapage jfs C error 306 36d 471d 0/26 upstream: reported C repro on 2023/01/02 10:00
linux-6.1 KASAN: use-after-free Read in release_metapage 1 210d 210d 0/3 auto-obsoleted due to no activity on 2023/12/29 12:55
linux-5.15 KASAN: use-after-free Read in release_metapage 1 188d 188d 0/3 auto-obsoleted due to no activity on 2024/01/20 09:39

Sample crash report:
audit: type=1800 audit(1667955175.385:94): pid=16705 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.5" name="file0" dev="sda1" ino=14242 res=0
syz-executor.5 (16705): drop_caches: 1
==================================================================
BUG: KASAN: use-after-free in drop_metapage fs/jfs/jfs_metapage.c:235 [inline]
BUG: KASAN: use-after-free in release_metapage+0x75e/0x7b0 fs/jfs/jfs_metapage.c:769
Read of size 8 at addr ffff8880a4dbc208 by task syz-executor.1/16679

CPU: 1 PID: 16679 Comm: syz-executor.1 Not tainted 4.14.298-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Call Trace:
syz-executor.5 (16705): drop_caches: 1
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1b2/0x281 lib/dump_stack.c:58
hid-generic 0000:0000:0000.000C: unknown main item tag 0x0
 print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252
hid-generic 0000:0000:0000.000C: unknown main item tag 0x0
 kasan_report_error.cold+0x8a/0x191 mm/kasan/report.c:351
hid-generic 0000:0000:0000.000C: unknown main item tag 0x0
hid-generic 0000:0000:0000.000C: unknown main item tag 0x0
 kasan_report mm/kasan/report.c:409 [inline]
 __asan_report_load8_noabort+0x68/0x70 mm/kasan/report.c:430
 drop_metapage fs/jfs/jfs_metapage.c:235 [inline]
 release_metapage+0x75e/0x7b0 fs/jfs/jfs_metapage.c:769
hid-generic 0000:0000:0000.000C: hidraw0: <UNKNOWN> HID v0.00 Device [syz1] on syz0
 write_metapage fs/jfs/jfs_metapage.h:88 [inline]
 flush_metapage fs/jfs/jfs_metapage.h:94 [inline]
 ea_write+0x4f1/0xb10 fs/jfs/xattr.c:293
 ea_put fs/jfs/xattr.c:623 [inline]
 __jfs_setxattr+0xc3b/0xdb0 fs/jfs/xattr.c:796
 __jfs_xattr_set+0xb9/0x130 fs/jfs/xattr.c:930
 __vfs_setxattr+0xdc/0x130 fs/xattr.c:150
 __vfs_setxattr_noperm+0xfd/0x3d0 fs/xattr.c:181
 __vfs_setxattr_locked+0x14d/0x250 fs/xattr.c:239
 vfs_setxattr+0xcf/0x230 fs/xattr.c:256
 setxattr+0x1a9/0x300 fs/xattr.c:523
 path_setxattr+0x118/0x130 fs/xattr.c:542
 SYSC_setxattr fs/xattr.c:557 [inline]
 SyS_setxattr+0x36/0x50 fs/xattr.c:553
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x5e/0xd3

Allocated by task 16679:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:551
 kmem_cache_alloc+0x124/0x3c0 mm/slab.c:3552
 mempool_alloc+0x10e/0x2d0 mm/mempool.c:330
 alloc_metapage fs/jfs/jfs_metapage.c:188 [inline]
 __get_metapage+0x588/0x10b0 fs/jfs/jfs_metapage.c:665
 ea_write+0x5b6/0xb10 fs/jfs/xattr.c:269
 ea_put fs/jfs/xattr.c:623 [inline]
 __jfs_setxattr+0xc3b/0xdb0 fs/jfs/xattr.c:796
 __jfs_xattr_set+0xb9/0x130 fs/jfs/xattr.c:930
 __vfs_setxattr+0xdc/0x130 fs/xattr.c:150
 __vfs_setxattr_noperm+0xfd/0x3d0 fs/xattr.c:181
 __vfs_setxattr_locked+0x14d/0x250 fs/xattr.c:239
 vfs_setxattr+0xcf/0x230 fs/xattr.c:256
 setxattr+0x1a9/0x300 fs/xattr.c:523
 path_setxattr+0x118/0x130 fs/xattr.c:542
 SYSC_setxattr fs/xattr.c:557 [inline]
 SyS_setxattr+0x36/0x50 fs/xattr.c:553
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x5e/0xd3

Freed by task 16705:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0xc3/0x1a0 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3496 [inline]
 kmem_cache_free+0x7c/0x2b0 mm/slab.c:3758
 mempool_free+0xcf/0x1d0 mm/mempool.c:439
 free_metapage fs/jfs/jfs_metapage.c:203 [inline]
 metapage_releasepage+0x171/0x210 fs/jfs/jfs_metapage.c:565
 try_to_release_page+0x143/0x1e0 mm/filemap.c:3243
 invalidate_complete_page mm/truncate.c:173 [inline]
 invalidate_inode_page+0x142/0x1c0 mm/truncate.c:227
 invalidate_mapping_pages+0x210/0x520 mm/truncate.c:548
 drop_pagecache_sb+0x1aa/0x260 fs/drop_caches.c:38
 iterate_supers+0x124/0x490 fs/super.c:613
 drop_caches_sysctl_handler+0xa5/0xe0 fs/drop_caches.c:61
 proc_sys_call_handler.isra.0+0x1ba/0x340 fs/proc/proc_sysctl.c:598
 __vfs_write+0xe4/0x630 fs/read_write.c:480
 __kernel_write+0xf5/0x330 fs/read_write.c:501
 write_pipe_buf+0x143/0x1c0 fs/splice.c:797
 splice_from_pipe_feed fs/splice.c:502 [inline]
 __splice_from_pipe+0x326/0x7a0 fs/splice.c:626
 splice_from_pipe fs/splice.c:661 [inline]
 default_file_splice_write+0xc5/0x150 fs/splice.c:809
 do_splice_from fs/splice.c:851 [inline]
 direct_splice_actor+0x115/0x160 fs/splice.c:1018
 splice_direct_to_actor+0x27c/0x730 fs/splice.c:973
 do_splice_direct+0x164/0x210 fs/splice.c:1061
 do_sendfile+0x47f/0xb30 fs/read_write.c:1441
 SYSC_sendfile64 fs/read_write.c:1496 [inline]
 SyS_sendfile64+0x9b/0x110 fs/read_write.c:1488
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x5e/0xd3

The buggy address belongs to the object at ffff8880a4dbc1e0
 which belongs to the cache jfs_mp of size 176
The buggy address is located 40 bytes inside of
 176-byte region [ffff8880a4dbc1e0, ffff8880a4dbc290)
The buggy address belongs to the page:
page:ffffea0002936f00 count:1 mapcount:0 mapping:ffff8880a4dbc000 index:0x0
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffff8880a4dbc000 0000000000000000 0000000100000011
raw: ffffea0002c310a0 ffff8880b0c3e648 ffff8880b0c41e40 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880a4dbc100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8880a4dbc180: fc fc fc fc fc fc fc fc fc fc fc fc fb fb fb fb
>ffff8880a4dbc200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                      ^
 ffff8880a4dbc280: fb fb fc fc fc fc fc fc fc fc fb fb fb fb fb fb
 ffff8880a4dbc300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/11/09 00:53 linux-4.14.y a901bb6c7db7 5fa28208 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in release_metapage
* Struck through repros no longer work on HEAD.