From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-il1-f207.google.com (mail-il1-f207.google.com [209.85.166.207]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6A1DC4594A for ; Tue, 21 Jan 2025 20:20:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.207 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737490823; cv=none; b=aWSHFKGxi4MIkaCwxXLVZ9TYjA6vhosnnCb8pN9yUBtBSgiOjeoqvNUPflIw9wNspPjvP125M1/k63h6IpqFXyaqqUxjSpRlba9RO+PFZl3b6szdTBwO9zCbzbpG/XF8gtybocsjw0BoO6F0nkVPt98jwoLZJ9sevrFRdHAOqQE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737490823; c=relaxed/simple; bh=qiBD2JJI8Nz1aotr/blbfrGZ26Ybpb4iNgHvDNSd1CM=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=NgyNrYnFnxKvpZK4LZxZnEe/htCy+XOj41VqmktYJK9ikLwic4vMRNCoAd5jTc+ScMvAddCr2cm3jNBLLXtoZ+3EzKP+dhGtobi7R0QphB3A4f9E0qvS3waaXih0HEvdwZDNMBD9UNGw1TbpnXIpNewxrd4mTVAs1ha1NMeK0Zw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.166.207 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-il1-f207.google.com with SMTP id e9e14a558f8ab-3a7e0d5899bso105151785ab.0 for ; Tue, 21 Jan 2025 12:20:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737490820; x=1738095620; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=PX7GMR++r+g93NMFWlTs9q/9qaBvn6LpHDs0SZTIdAw=; b=i+0GxCZSGzOqs2j+u4mzS8oj1XYbly8VxQeab+RW8VAidK0ZEgpSLI9bAeXE861mNi rUIZQfDqoNgT4dybBFiUimERJLN5CC4alYSxtbnp88pyJvykP+mi0MUYT9dowInpj6R4 7Q41Wsvtx3AzVua4RVz11boKd93eBVx2++J1yI+iiBxAj04JWpBLDgBKvjfviwrLHe/L OdBymtqj1DdvQTBD/Qn03iQKWe3jZVY5AhATXpDacUt8VITUusiv/Axqxy6zlaQsjxoQ jfthjarDlcUL4/p7buhKcjNcVOSR+TczlP6RC5z7TqwC3Wq9Oy/QDGzNg059VOlEKbo9 wH4A== X-Forwarded-Encrypted: i=1; AJvYcCWmvGmPPbtLW5hLgveQSswpbbzgLxOKKCRSeBYB+JIUOTix4x4wcC2SZ+YWIcxKGv/dYKVx8cWIloqSl7I=@vger.kernel.org X-Gm-Message-State: AOJu0Yy2aHckXo1irSz6EfHfDDCqjuDGBRGQCuyezfDrXMsH+ozmRLHC zFmYaYwwP4/tD+kKeidsSf5KryOakPTzrtAE4OK4379kOSYbY+XUKcTnRJvN+iXbSvHc3HqlD68 vpFIeR5V2Vc5bHZ+d+lGDQuURN8QBg7oOA6zh7weeel1CPTWHB736i54= X-Google-Smtp-Source: AGHT+IE/U0DA2BFVTMtvEfFssNThBdU8HcoW2f5ylYH1uriOHuafy1sdigXyComnwBuuAPpqhajKFWNbEu80xJZosyZCfWqd1cRW Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6e02:3f03:b0:3ce:87e3:c26c with SMTP id e9e14a558f8ab-3cf743df88amr183524485ab.5.1737490820484; Tue, 21 Jan 2025 12:20:20 -0800 (PST) Date: Tue, 21 Jan 2025 12:20:20 -0800 In-Reply-To: <6745ebeb.050a0220.21d33d.001a.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <67900184.050a0220.15cac.00db.GAE@google.com> Subject: Re: [syzbot] [jfs?] UBSAN: array-index-out-of-bounds in add_missing_indices From: syzbot To: jfs-discussion@lists.sourceforge.net, linux-kernel@vger.kernel.org, shaggy@kernel.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" syzbot has found a reproducer for the following issue on: HEAD commit: 1950a0af2d55 Merge tag 'arm64-upstream' into for-kernelci git tree: git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci console output: https://syzkaller.appspot.com/x/log.txt?x=113b2424580000 kernel config: https://syzkaller.appspot.com/x/.config?x=cd5bb525e2b2bae dashboard link: https://syzkaller.appspot.com/bug?extid=b974bd41515f770c608b compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40 userspace arch: arm64 syz repro: https://syzkaller.appspot.com/x/repro.syz?x=11d0d618580000 C reproducer: https://syzkaller.appspot.com/x/repro.c?x=153b2424580000 Downloadable assets: disk image: https://storage.googleapis.com/syzbot-assets/1ebe061fa55c/disk-1950a0af.raw.xz vmlinux: https://storage.googleapis.com/syzbot-assets/943902875907/vmlinux-1950a0af.xz kernel image: https://storage.googleapis.com/syzbot-assets/9b5110e82096/Image-1950a0af.gz.xz mounted in repro: https://storage.googleapis.com/syzbot-assets/6e79f480238f/mount_0.gz IMPORTANT: if you fix the issue, please add the following tag to the commit: Reported-by: syzbot+b974bd41515f770c608b@syzkaller.appspotmail.com ... Log Wrap ... Log Wrap ... Log Wrap ... ------------[ cut here ]------------ UBSAN: array-index-out-of-bounds in fs/jfs/jfs_dtree.c:2649:28 index -128 is out of range for type 'struct dtslot[128]' CPU: 1 UID: 0 PID: 6414 Comm: syz-executor126 Not tainted 6.13.0-rc7-syzkaller-g1950a0af2d55 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call trace: show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:466 (C) __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:120 dump_stack+0x1c/0x28 lib/dump_stack.c:129 ubsan_epilogue lib/ubsan.c:231 [inline] __ubsan_handle_out_of_bounds+0xf8/0x148 lib/ubsan.c:429 add_missing_indices+0x6e4/0xa8c fs/jfs/jfs_dtree.c:2649 jfs_readdir+0x18ac/0x3030 fs/jfs/jfs_dtree.c:3019 wrap_directory_iterator+0xa8/0xf4 fs/readdir.c:65 shared_jfs_readdir+0x30/0x40 fs/jfs/namei.c:1540 iterate_dir+0x408/0x648 fs/readdir.c:108 __do_sys_getdents64 fs/readdir.c:403 [inline] __se_sys_getdents64 fs/readdir.c:389 [inline] __arm64_sys_getdents64+0x1c0/0x490 fs/readdir.c:389 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:744 el0t_64_sync_handler+0x84/0x108 arch/arm64/kernel/entry-common.c:762 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600 ---[ end trace ]--- ================================================================== BUG: KASAN: slab-out-of-bounds in diWrite+0xb48/0x15cc fs/jfs/jfs_imap.c:753 Read of size 32 at addr ffff0000dea84108 by task syz-executor126/6414 CPU: 1 UID: 0 PID: 6414 Comm: syz-executor126 Not tainted 6.13.0-rc7-syzkaller-g1950a0af2d55 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call trace: show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:466 (C) __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x198/0x538 mm/kasan/report.c:489 kasan_report+0xd8/0x138 mm/kasan/report.c:602 kasan_check_range+0x268/0x2a8 mm/kasan/generic.c:189 __asan_memcpy+0x3c/0x84 mm/kasan/shadow.c:105 diWrite+0xb48/0x15cc fs/jfs/jfs_imap.c:753 txCommit+0x750/0x5504 fs/jfs/jfs_txnmgr.c:1255 add_missing_indices+0x760/0xa8c fs/jfs/jfs_dtree.c:2663 jfs_readdir+0x18ac/0x3030 fs/jfs/jfs_dtree.c:3019 wrap_directory_iterator+0xa8/0xf4 fs/readdir.c:65 shared_jfs_readdir+0x30/0x40 fs/jfs/namei.c:1540 iterate_dir+0x408/0x648 fs/readdir.c:108 __do_sys_getdents64 fs/readdir.c:403 [inline] __se_sys_getdents64 fs/readdir.c:389 [inline] __arm64_sys_getdents64+0x1c0/0x490 fs/readdir.c:389 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:744 el0t_64_sync_handler+0x84/0x108 arch/arm64/kernel/entry-common.c:762 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600 The buggy address belongs to the object at ffff0000dea84088 which belongs to the cache jfs_ip of size 2232 The buggy address is located 128 bytes inside of allocated 2232-byte region [ffff0000dea84088, ffff0000dea84940) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11ea80 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x5ffc00000000040(head|node=0|zone=2|lastcpupid=0x7ff) page_type: f5(slab) raw: 05ffc00000000040 ffff0000c486ec80 dead000000000122 0000000000000000 raw: 0000000000000000 00000000800d000d 00000001f5000000 0000000000000000 head: 05ffc00000000040 ffff0000c486ec80 dead000000000122 0000000000000000 head: 0000000000000000 00000000800d000d 00000001f5000000 0000000000000000 head: 05ffc00000000003 fffffdffc37aa001 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000dea84000: 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff0000dea84080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff0000dea84100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff0000dea84180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff0000dea84200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== ... Log Wrap ... Log Wrap ... Log Wrap ... ... Log Wrap ... Log Wrap ... Log Wrap ... ... Log Wrap ... Log Wrap ... Log Wrap ... ERROR: (device loop0): jfs_readdir: JFS:Dtree error: ino = 2, bn=0, index = 0 ERROR: (device loop0): remounting filesystem as read-only JFS: Invalid stbl[1] = -128 for inode 2, block = 0 --- If you want syzbot to run the reproducer, reply with: #syz test: git://repo/address.git branch-or-commit-hash If you attach or paste a git patch, syzbot will apply it before testing.