From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f69.google.com (mail-oo1-f69.google.com [209.85.161.69]) (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 B24A228850E for ; Fri, 17 Apr 2026 16:20:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.69 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776442834; cv=none; b=J+3T2A1k8MtEmYscH8S4PfNZ1SDy5DUEZtsN4iXk1tJhvNL+8kYPuaQQJ24xYaCfMTTjk0xXIkTBfLXmYh6ae/AKpfZZ0kNHLEIyHeYImsjqE/ed41dY8Owv42/iAbdI217noy188uQ1OsdWThXu3fD9WT/FM9PQHXmzpSNOer0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776442834; c=relaxed/simple; bh=66ZkQ7+0Fg4SJwxim3ethLgiRVgLRSQ3PnuJdr0EvIs=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=cYP8TVeWZbAoaM/13De/eoxuMi+a7qz4tXlI9VyTLYEqPCrW0dG5lBUH2FQ9PFcdRQCeR+jrqHyqyxJVyJl77x9ypBXfnxFP36043j5i4SA4QRPCjJ64x+IOGEB1PculDYKopCBMkebTVsxHOz+Y+VTwuGaJoqzEAkYq5ZRisxI= 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.69 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-f69.google.com with SMTP id 006d021491bc7-672c40f3873so1907021eaf.2 for ; Fri, 17 Apr 2026 09:20:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776442833; x=1777047633; 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=xuKhgEq2sFdhoH0upeoHSoGz/tb3n186HW74OSa8hco=; b=CkxP+OgAa9Y3gZHfHv//NOpS4gshSufED3O7kryd9BZwPsQ/zfVwz/5veLRvBmb8ZX MRtVKfV5OoHI1Tx58V/X/tH1rrpU/V+jAPTJfXdRwuAc7eCejqVb97JM8Dpzjor/cIZj f3c23jRWqpMcMUt22cB54U5I6dG6utt2ggJMGgCm316MWXE8vxVgcXAkG9La+X/MYHk3 5gUstKKcbf+5D2O3YwHp9ZP5yHf2CflZ5LVh0DLSMi0M20K69CIRTXQoKfGk7nj0FC+M +SVchCstlakgqeGHSbbAsZ9/t6HESfOcFwPnlM6wgyF2DQBNIIJJr4901FkWugKbYUmB x/lg== X-Gm-Message-State: AOJu0YzjDygQcWrG7l3bcDjLC4RyKdvEVDtF7MHioblsG1anJ13vBrMQ F99rR1n5lOiyt4VItGVccTvneKMl7NGIP5+ehPGGy4nFkfB2H6GAeWJI6IUN6uTIbIC9Ce/BjkR yhgV4+E/gYJ9vx4tzIi3rgqdFIc5hCy1/7gBvTlhTk+0WMwI/8mDafR+xsew= 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:c90:b0:688:6d55:195 with SMTP id 006d021491bc7-69462f2f14fmr2033174eaf.57.1776442832806; Fri, 17 Apr 2026 09:20:32 -0700 (PDT) Date: Fri, 17 Apr 2026 09:20:32 -0700 In-Reply-To: <68f1c794.a00a0220.361615.000f.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <69e25dd0.050a0220.1de265.0029.GAE@google.com> Subject: Forwarded: Re: [syzbot] UBSAN: shift-out-of-bounds in dbAllocAG 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 dbAllocAG Author: tristmd@gmail.com #syz test: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master >>From 68c84cc03503804c418f99cf442b48de6959405b Mon Sep 17 00:00:00 2001 From: Tristan Madani Date: Fri, 17 Apr 2026 16:15:15 +0000 Subject: [PATCH] jfs: add upper bound check for budmin in check_dmapctl() check_dmapctl() validates that budmin >= BUDMIN but does not check the upper bound. A corrupted filesystem image can set budmin to a value larger than L2MAXL2SIZE, causing UBSAN shift-out-of-bounds when the value is used as a shift count in dbAllocAG() and dbFindCtl(). Add an upper bound check on budmin in check_dmapctl() to reject values exceeding L2MAXL2SIZE. Reported-by: syzbot+4b717071f1eecb2972df@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=4b717071f1eecb2972df Signed-off-by: Tristan Madani --- fs/jfs/jfs_dmap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/jfs/jfs_dmap.c b/fs/jfs/jfs_dmap.c index a841cf2..eb7c3ba 100644 --- a/fs/jfs/jfs_dmap.c +++ b/fs/jfs/jfs_dmap.c @@ -190,9 +190,9 @@ static bool check_dmapctl(struct dmapctl *dcp) nleafs); return false; } - } else if (unlikely(budmin < BUDMIN)) { - jfs_err("dmapctl: invalid budmin %d (min %d)", - budmin, BUDMIN); + } else if (unlikely(budmin < BUDMIN || budmin > L2MAXL2SIZE)) { + jfs_err("dmapctl: invalid budmin %d (valid range %d-%d)", + budmin, BUDMIN, L2MAXL2SIZE); return false; } -- 2.47.3