syzbot


KASAN: use-after-free Read in dbNextAG

Status: upstream: reported C repro on 2022/09/25 01:19
Reported-by: syzbot+a679e589b848dbf6fc9c@syzkaller.appspotmail.com
First crash: 790d, last: 641d
Similar bugs (5)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 KASAN: use-after-free Read in dbNextAG jfs C error 12 685d 790d 0/1 upstream: reported C repro on 2022/09/25 01:19
linux-6.1 UBSAN: array-index-out-of-bounds in dbNextAG origin:upstream missing-backport C error 3 45d 139d 0/3 upstream: reported C repro on 2024/07/07 08:50
linux-5.15 UBSAN: array-index-out-of-bounds in dbNextAG origin:upstream C done 4 46d 139d 3/3 fixed on 2024/11/14 06:35
upstream UBSAN: array-index-out-of-bounds in dbNextAG (2) jfs C inconclusive 53 65d 135d 28/28 fixed on 2024/10/22 15:46
upstream UBSAN: array-index-out-of-bounds in dbNextAG jfs C inconclusive inconclusive 52 361d 789d 25/28 fixed on 2023/12/21 01:43
Fix bisection attempts (3)
Created Duration User Patch Repo Result
2023/02/21 12:45 35m bisect fix linux-4.14.y OK (0) job log log
2023/01/21 11:04 27m bisect fix linux-4.14.y OK (0) job log log
2022/11/04 14:49 22m bisect fix linux-4.14.y OK (0) job log log

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in __read_once_size include/linux/compiler.h:185 [inline]
BUG: KASAN: use-after-free in atomic_read arch/x86/include/asm/atomic.h:27 [inline]
BUG: KASAN: use-after-free in dbNextAG+0x2ff/0x370 fs/jfs/jfs_dmap.c:630
Read of size 4 at addr ffff8880b5724798 by task syz-executor141/7973

CPU: 1 PID: 7973 Comm: syz-executor141 Not tainted 4.14.295-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1b2/0x281 lib/dump_stack.c:58
 print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252
 kasan_report_error.cold+0x8a/0x191 mm/kasan/report.c:351
 kasan_report mm/kasan/report.c:409 [inline]
 __asan_report_load4_noabort+0x68/0x70 mm/kasan/report.c:429
 __read_once_size include/linux/compiler.h:185 [inline]
 atomic_read arch/x86/include/asm/atomic.h:27 [inline]
 dbNextAG+0x2ff/0x370 fs/jfs/jfs_dmap.c:630
 diAlloc+0x87a/0x1230 fs/jfs/jfs_imap.c:1386
 ialloc+0x7b/0x940 fs/jfs/jfs_inode.c:70
 jfs_mkdir.part.0+0xfd/0x7e0 fs/jfs/namei.c:238
 jfs_mkdir+0x35/0x50 fs/jfs/namei.c:223
 vfs_mkdir+0x463/0x6e0 fs/namei.c:3851
 SYSC_mkdirat fs/namei.c:3874 [inline]
 SyS_mkdirat+0x1fd/0x270 fs/namei.c:3858
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x7f591db2b009
RSP: 002b:00007fff29984658 EFLAGS: 00000246 ORIG_RAX: 0000000000000102
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f591db2b009
RDX: 0000000000000000 RSI: 0000000020000200 RDI: 0000000000000003
RBP: 00007f591daea870 R08: 0000000000000000 R09: 00007f591daea870
R10: 0000555555b8c2c0 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00080000000000f4 R15: 0000000000000000

Allocated by task 1:
 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
 getname_flags+0xc8/0x550 fs/namei.c:138
 do_sys_open+0x1ce/0x410 fs/open.c:1075
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb

Freed by task 1:
 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
 putname+0xcd/0x110 fs/namei.c:259
 do_sys_open+0x203/0x410 fs/open.c:1090
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb

The buggy address belongs to the object at ffff8880b57243c0
 which belongs to the cache names_cache of size 4096
The buggy address is located 984 bytes inside of
 4096-byte region [ffff8880b57243c0, ffff8880b57253c0)
The buggy address belongs to the page:
page:ffffea0002d5c900 count:1 mapcount:0 mapping:ffff8880b57243c0 index:0x0 compound_mapcount: 0
flags: 0xfff00000008100(slab|head)
raw: 00fff00000008100 ffff8880b57243c0 0000000000000000 0000000100000001
raw: ffffea0002d5ad20 ffffea0002d41620 ffff88823f8c1200 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880b5724680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8880b5724700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880b5724780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                            ^
 ffff8880b5724800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8880b5724880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/10/03 12:55 linux-4.14.y 9d5c0b3a8e1a feb56351 .config console log report syz C [disk image] [vmlinux] ci2-linux-4-14 KASAN: use-after-free Read in dbNextAG
2022/09/25 01:18 linux-4.14.y 4edbf74132a4 0042f2b4 .config console log report syz C [disk image] [vmlinux] ci2-linux-4-14 KASAN: use-after-free Read in dbNextAG
* Struck through repros no longer work on HEAD.