From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oa1-f70.google.com (mail-oa1-f70.google.com [209.85.160.70]) (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 1D45A28850E for ; Fri, 17 Apr 2026 16:19:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.70 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776442793; cv=none; b=plUITff9BEnUQMq/D4igjOkcec/ZnjsZWawhhcxEBBurnQ2jvcl2C+f09vS7UL0RxzRi1u0GpsWsfAdkzhgS6vlaAvEY7OlpzqdDT2V2uSe0YnchhS7odXCH3+zB4294et8cIQg8rkUGn5xcoULHO6ViWRA/rdTck2vSlx/b5bo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776442793; c=relaxed/simple; bh=jTGUBl4t+YuW5jkKar8aSTMD+ZPewLeR/X/Nl84uw+Q=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=CCHPO+IDa2D2w7gZNueyiqi+0CSRhIF4RoSdGuH0LZmdMzPoqFOgQc6XWoHohZXjkeF6dpA2sq251amhMXTkKaznRtEqznZJWr101T/2YGgLGGx86phdBfLeM9d9ir0/NJRInrXrkFYFFhjr6A9eHTp57v/2bI6QuFdWXLbggC0= 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.160.70 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-oa1-f70.google.com with SMTP id 586e51a60fabf-40ee506cf49so1273045fac.2 for ; Fri, 17 Apr 2026 09:19:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776442791; x=1777047591; 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=PcFySKdvcmTUGl/Hoggx7oieK2ykq0MpK9aCqsn+kd0=; b=LFRkbPloiEfP+xawjbb1jkd15DG4umk61K54b5XhRu/1nSTUEgaGu4E3LzyOnMqIp/ exJOOugDHezIomPGP0Lv7A+v6FepVmcpvwFVojs759QMG88ORhfGWfXyPcOTC5Xwxe3W dwNpokNZyUlgYScJDIqIt/dwZht/kkISaNBRcSAxBEQZYCEMucAnK2GJ29eN5bgHa1vr 7ykknB/p4U9l7vdPvAEoPgU/sbRGHqV6hSogy5zIRTf7ZGCWvk0BvBc+gbS9opYpYF7a IlFUXqScA+uXyNBzh/qDN8p79S0Sj9Y/Xr5Ul19l+JA+/KzhzlF0VZYzi9O5Vh8d66iz DG/A== X-Gm-Message-State: AOJu0Yx4li05+5RMpg2bZBGQ1TYaFVpp/1MJ6mUd0ZCXnv5ov28Dt4tv jySsv5ZkDA2Uyuy75qTRLuKpReczHGncludBvEAtDr4j/rJEJhmpR0Sj/hEmbnMWrKr9AxEnFhr oFQj24YAdx12fxq7Xnqgbofx+QoGYCeR2OkFhc3YINGE7qFcgrd7TSwhZVbA= 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:6820:1c8d:b0:683:c005:54fa with SMTP id 006d021491bc7-69462ee4596mr1933049eaf.41.1776442791075; Fri, 17 Apr 2026 09:19:51 -0700 (PDT) Date: Fri, 17 Apr 2026 09:19:51 -0700 In-Reply-To: <695faa63.050a0220.1c677c.039a.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <69e25da7.050a0220.1de265.0027.GAE@google.com> Subject: Forwarded: Re: [syzbot] UBSAN: array-index-out-of-bounds in dbFindLeaf From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: Re: [syzbot] UBSAN: array-index-out-of-bounds in dbFindLeaf Author: tristmd@gmail.com #syz test: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master >>From 9fdbd0cb4943449d1104e60ec721d8dbe92a56ff Mon Sep 17 00:00:00 2001 From: Tristan Madani Date: Fri, 17 Apr 2026 16:15:14 +0000 Subject: [PATCH] jfs: fix array-index-out-of-bounds in dbFindLeaf dbFindLeaf() uses an off-by-one comparison when checking array bounds: `if (x + n > max_size)` should be `>= max_size` since array indices are 0-based and max_size is the total element count. When x + n equals max_size, the access tp->dmt_stree[x + n] reads one element past the end of the array. Fix by using >= instead of > in the bounds check. Reported-by: syzbot+1afe7ef2d0062e19eeb3@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=1afe7ef2d0062e19eeb3 Signed-off-by: Tristan Madani --- fs/jfs/jfs_dmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/jfs/jfs_dmap.c b/fs/jfs/jfs_dmap.c index a841cf2..cbdcc8d 100644 --- a/fs/jfs/jfs_dmap.c +++ b/fs/jfs/jfs_dmap.c @@ -3058,7 +3058,7 @@ static int dbFindLeaf(dmtree_t *tp, int l2nb, int *leafidx, bool is_ctl) /* sufficient free space found. move to the next * level (or quit if this is the last level). */ - if (x + n > max_size) + if (x + n >= max_size) return -ENOSPC; if (l2nb <= tp->dmt_stree[x + n]) break; -- 2.47.3