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 1A64027442 for ; Thu, 30 Apr 2026 22:41:48 +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=1777588910; cv=none; b=T22J2U1eV+ny4I1S6BX5rJtQsIxJfRSwv71q+5rE//aFqp/XirtPo4E7+Bcgfb09luS5uVXavA7pac3ZKudN2ipvFP5bQa/2wjoZsLd8tkh2C7G64rpwGs8vkCxJ9fUHmYso33J+XSicLN7Mo/qQq3jBuXQXObIuYtAT6jkEZ8k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777588910; c=relaxed/simple; bh=uFoQWGGi5a+D44MNO4itSUNzKkY62Fyiv2sNfAbkOE8=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=uwvkdHp+DniDuZoHbkWPJQ9H3PaI0HgLCTXt4GamV8oQ6Pm0o58+CLBvYPHcGSf5T1U6REeSQb7V/7blb2ONGVDctCCaRp8FmR6y1r27GIdYOkZfrH5AdXBLQWrZOK+v+9sHCL5SA7WHApHURcQk+0O//iUw5QNTNLd3CzjBL1o= 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-6949ebccfcdso2011462eaf.2 for ; Thu, 30 Apr 2026 15:41:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777588908; x=1778193708; 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=h7whe53pTil+/7kEhmAgs+Sd2hT/4arIr21eHFA/GTo=; b=NpWPc8HeJwFhoYNAOWdRjzgN7h515kJgLgOPI1CKLHxGhGFmtmVbB09MQOkmmNKtqh eVGxUdHNRGh2MQVwAms2ddJD1aYR7VAetwv5P+5rLkA6FnE6I8MIyUWOiYU1L5HCF19a zs+ZzBfGbXO9XeG6hJbLAUfx2Ss0pSFGhx3XkclAeLygjrIkHIhtO6jQ2H4ONry/21+7 IetbqcWYfoUpxCkaHF8UCH+Ts/jNx/vEUmJJM/1J1BlFTNSm81NtEf1AhhmaQtXEU7z1 IU9IdmxNt6I6GuN49SNYCrVAaApds1pfunpA/29KvmPSF1TDsv4WH1Ticpi/nVzikyz8 B0aQ== X-Gm-Message-State: AOJu0YwNeUilHQ3CbLCXbZIsECn2RpovPSIHBOJQ1BTIv6alfpijqEUs 4TD1juWtTs6TykcGQPs1VYdbNJRxql2U8o/lRIMqt4Pxhx+/VVRLnswrB/+CS25AjG8VhkHCD4b ekyrEDoEge3uEdbTwQUYuXEUAy/waBc7pBSDT+K6ldHwHXojDyw+555GhQNs= 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:1507:b0:692:3df6:79c6 with SMTP id 006d021491bc7-6967a624b80mr2810812eaf.49.1777588908171; Thu, 30 Apr 2026 15:41:48 -0700 (PDT) Date: Thu, 30 Apr 2026 15:41:48 -0700 In-Reply-To: <000000000000707b50060f85bb0e@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <69f3daac.050a0220.312cd3.0004.GAE@google.com> Subject: Forwarded: Re: [syzbot] [hfs?] KASAN: out-of-bounds Read in hfs_bnode_move 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] [hfs?] KASAN: out-of-bounds Read in hfs_bnode_move Author: tristmd@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master >>From 481707e6b354ae2f36603d68c63364b56d6ee6b6 Mon Sep 17 00:00:00 2001 From: Tristan Madani Date: Thu, 30 Apr 2026 22:38:32 +0000 Subject: [PATCH 1/3] hfs/hfsplus: fix u32 overflow in check_and_correct_requested_length check_and_correct_requested_length() compares (off + len) against node_size using u32 arithmetic. When the caller passes a large len value (e.g. from an underflowed subtraction in hfs_brec_remove()), off + len can wrap past 2^32 and produce a small result, causing the bounds check to pass when it should fail. For example, with off=14 and len=0xFFFFFFF2 (underflowed from data_off - keyoffset - size in hfs_brec_remove), off + len wraps to 6, which is less than a typical node_size of 512, so the check passes and the subsequent memmove reads ~4GB past the node buffer. Fix this by comparing len against (node_size - off) instead. Since is_bnode_offset_valid() already guarantees off < node_size before this point, the subtraction cannot underflow. Reported-by: syzbot+6df204b70bf3261691c5@syzkaller.appspotmail.com Reported-by: syzbot+e76bf3d19b85350571ac@syzkaller.appspotmail.com Fixes: a431930c9bac ("hfs: fix slab-out-of-bounds in hfs_bnode_read()") Cc: stable@vger.kernel.org Signed-off-by: Tristan Madani --- fs/hfs/bnode.c | 2 +- fs/hfsplus/hfsplus_fs.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/hfs/bnode.c b/fs/hfs/bnode.c index 13d58c51fc46b..c00645a4a5733 100644 --- a/fs/hfs/bnode.c +++ b/fs/hfs/bnode.c @@ -41,7 +41,7 @@ u32 check_and_correct_requested_length(struct hfs_bnode *node, u32 off, u32 len) node_size = node->tree->node_size; - if ((off + len) > node_size) { + if (len > node_size - off) { u32 new_len = node_size - off; pr_err("requested length has been corrected: " diff --git a/fs/hfsplus/hfsplus_fs.h b/fs/hfsplus/hfsplus_fs.h index 3545b8dbf11c5..10b2dda3f8044 100644 --- a/fs/hfsplus/hfsplus_fs.h +++ b/fs/hfsplus/hfsplus_fs.h @@ -600,7 +600,7 @@ u32 check_and_correct_requested_length(struct hfs_bnode *node, u32 off, u32 len) node_size = node->tree->node_size; - if ((off + len) > node_size) { + if (len > node_size - off) { u32 new_len = node_size - off; pr_err("requested length has been corrected: " -- 2.47.3