From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ot1-f69.google.com (mail-ot1-f69.google.com [209.85.210.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 862D43016F2 for ; Tue, 5 May 2026 11:12:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.69 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777979565; cv=none; b=S7WeiDkX5+fL0Uw02HDNfIeyYJ4h6Pk6tqdnx11xsi3rZl5sFttfz2uISo0fZTZuI6IO5O1+5sFK8f/Lyj72N8wy+Q5debyGzFVed3KvELN7mptfKMo83m0pb0DZ+81NNg9zsJ55a5dKOynImxCilWT9vLC+3um6tC3XYvRmbBk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777979565; c=relaxed/simple; bh=WHKvVIoXVJZrsd+0SbyoPwk8/Ew6GceIjITrUQGDZmo=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=eL3YIbdDNoxYvGOKYLb9B1c595FnB0qjayqj5GFrb6DFHF3fGvA6hgwuBgSTbhPYPnUvLWu5EMzL2bFsJEs0LFab2ztX3g3sjaxsV6zMhKQ+h+oneIejrAd+z7ED9Wwq3VTdKiQlSw4MtUTLtM+E5ZXhIx2kVCjUXqviKo4rlSA= 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.210.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-ot1-f69.google.com with SMTP id 46e09a7af769-7deb9de359bso6324195a34.3 for ; Tue, 05 May 2026 04:12:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777979563; x=1778584363; 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=klkfmpFFNGoQaP2ripbDbYHafubHGc7+j21b4x369os=; b=kLwbeK2pz6bdyhAQ7FI1IZpAhVzEyqclVzPcZnqmNyQVSFCAn/nEzSd+lUOxspOhBi Sz9fHn5MzvHnra3C7nkLMhMFDCv271LODm6NtDNpFJFkZ9VX3+XiuJ2lZQ9dJ3ntNhdB 72+KmtyMSZt8C4ddRolU/DRDlRPceJfbAxIgTunA/hFqSJgoJIJJqO5GDaGyxjruMIDU Jn+OMazFj/dGcrqIhsQ9TB80WT5DVt+HJl31bNy9reAfZ/+lB2rymW60xpU+JMEFlCs2 zCGrwUBi4byQTuAlb0PY8x6C6xfa+ricUzfFa+tN1hQ7cVY0uxoOxvugYdS9QzfBiJjX wWnw== X-Gm-Message-State: AOJu0YwTOua1BUCb/+rm5LLh2Wox4vMIZTQSIceadSmJzVKTqNKN9fFv YOH2k/ZGqKcVITdEkMn7f6/d27V/yVAnV4Lb5M/8YAQS5sg6Po9IEmJo/YHMdFb5FXXbkcGrbN+ xs/m/1WGJcQI9qQwkCmEkixpoJXTIqEEN+lYNQHcrMyYv0DTlgNO/QxQrscw= 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:1890:b0:696:2674:8a07 with SMTP id 006d021491bc7-6998d21c0c5mr938734eaf.33.1777979563546; Tue, 05 May 2026 04:12:43 -0700 (PDT) Date: Tue, 05 May 2026 04:12:43 -0700 In-Reply-To: <0000000000002a358205ee5b22d8@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <69f9d0ab.170a0220.59368.000e.GAE@google.com> Subject: Forwarded: Re: [syzbot] KASAN: slab-out-of-bounds in hfs_bnode_read 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] KASAN: slab-out-of-bounds in hfs_bnode_read Author: tristmd@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master >>From f6b9bdbe52aac7659475c0474819f7b6c837761f Mon Sep 17 00:00:00 2001 From: Tristan Madani Date: Tue, 5 May 2026 11:05:24 +0000 Subject: [PATCH v2 1/2] 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 widening the addition to u64 before comparing against node_size. This prevents the u32 wrap while keeping the logic straightforward. Reported-by: syzbot+6df204b70bf3261691c5@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=6df204b70bf3261691c5 Tested-by: syzbot+6df204b70bf3261691c5@syzkaller.appspotmail.com Reported-by: syzbot+e76bf3d19b85350571ac@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=e76bf3d19b85350571ac Tested-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..9571f33b91085 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 ((u64)off + len > node_size) { 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..0e4268de9e60e 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 ((u64)off + len > node_size) { u32 new_len = node_size - off; pr_err("requested length has been corrected: " -- 2.47.3