From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f71.google.com (mail-oo1-f71.google.com [209.85.161.71]) (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 7383728F5 for ; Fri, 17 Apr 2026 16:19:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.71 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776442799; cv=none; b=i7icQ2Z37WmA7Lvj4J1czUjGyjWqJturgMZJULgxfDBugxHL7rz8y6sb5zvCpEcN3IDE56CIfUbnjPbr0f6luNrY8cORclkkNk6IFRzYMuv2N4J3p59pK2p8s9bw8vEDl3c6IatsSRLoS3MrAwnN/jNlo39B9FZ5bE6GLNBV9j0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776442799; c=relaxed/simple; bh=ueAE5AnHeIms4d9iCcMDObR0njQkaQJNZR+qPmG0ykM=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=qMRFAZdmWM3E6SmAAijVvY8wzOLa8URGmm0FACsBM7dZc59saNfio/s4hc4fJFUaaUmBryx8TraGeWsiSvL6Meddlc4B6uIOWSqyvnecH6qd9QI7kZXn0sYmZbYOK1UOF+ywQiMC4dH36L3LaLaGZsM9Ji+x0dVy7RhFczzoxfM= 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.161.71 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-oo1-f71.google.com with SMTP id 006d021491bc7-68826165bc9so946327eaf.0 for ; Fri, 17 Apr 2026 09:19:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776442797; x=1777047597; 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=a/1ptxDo5BJEA20b9Jpmes2B6AyTfAEBBdQiWoaph48=; b=mfjfsqQvrZaJp7ctipPJo3zaaacQGU8FjJnFdFkBD2pEhBgBwl2RQX6s8YDwR6zOdx i95KbsIMh4FJL3GkcoSslDCq/ZzM5nWnwnKff3CJMD3FAbwUGBQ0RYyXn6PlrrvLA75w vRnV9xYQn8cRYE/MjlOmcx0435ftk9i3oz7DzZuKrIxmrnAueOluEYfgv60dg3/GmJsF /pLJ1IA9wiZopGfvFPc/37ijgxm1IzkRiHsaXGklHHH61rSp8XM139m/QmITT7+eXPn5 0P7MhT26kej03L883qoY3tR1Relf3mlLdUgVebTMeZ+TVM2+wMrwy4yDONkQLO816zZa XggA== X-Gm-Message-State: AOJu0Yzbp2966AE+RCbh5p2cZq3KFdS+cr1dn9tSzA5cm/frulYqLfaE GPwM0YcY0KiPwC+Ub5W2JOMPxb2I23T0Jrp8SxOYRIZ1WZGfsXphO3KG4VQhyjUVxEkjnNbeBU7 4cqD5lkQ7amZJKZ+gE8CP7CUvyOYlbS/FqANmUSzfWZCOiYsTiesgxamcYVo= 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:858c:10b0:680:89db:fd78 with SMTP id 006d021491bc7-69462e2042dmr1270628eaf.1.1776442797475; Fri, 17 Apr 2026 09:19:57 -0700 (PDT) Date: Fri, 17 Apr 2026 09:19:57 -0700 In-Reply-To: <69345a63.a70a0220.38f243.0031.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <69e25dad.a00a0220.1bd0ca.0008.GAE@google.com> Subject: Forwarded: Re: [syzbot] UBSAN: shift-out-of-bounds in dbJoin 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: shift-out-of-bounds in dbJoin Author: tristmd@gmail.com #syz test: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master >>From b3eba06211261ff42d58377c02b45bf48aae8f82 Mon Sep 17 00:00:00 2001 From: Tristan Madani Date: Fri, 17 Apr 2026 16:15:14 +0000 Subject: [PATCH] jfs: fix shift-out-of-bounds in dbJoin dbJoin() can receive a corrupted newval from on-disk metadata that exceeds the valid range for the BUDSIZE macro's shift operation. When newval is larger than budmin + l2nleafs, the shift produces undefined behavior detected by UBSAN. Add a sanity check on newval before the shift to reject corrupted values. Reported-by: syzbot+fa603ae6b02658401ca7@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=fa603ae6b02658401ca7 Signed-off-by: Tristan Madani --- fs/jfs/jfs_dmap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/jfs/jfs_dmap.c b/fs/jfs/jfs_dmap.c index a841cf2..4ad9b34 100644 --- a/fs/jfs/jfs_dmap.c +++ b/fs/jfs/jfs_dmap.c @@ -2864,6 +2864,9 @@ static int dbJoin(dmtree_t *tp, int leafno, int newval, bool is_ctl) if (newval >= tp->dmt_budmin) { /* pickup a pointer to the leaves of the tree. */ + if (newval > tp->dmt_budmin + + le32_to_cpu(tp->dmt_l2nleafs)) + return -EIO; leaf = tp->dmt_stree + le32_to_cpu(tp->dmt_leafidx); /* try to join the specified leaf into a large binary -- 2.47.3