From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ot1-f70.google.com (mail-ot1-f70.google.com [209.85.210.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 7A1083016F2 for ; Tue, 5 May 2026 11:12:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.70 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777979558; cv=none; b=CRegH4LdKsvU/k1owVoZRMHgTb5OkvDIpxKlHNuKV59cnrtPkZ0m2xQILBTP4km9+cW5vLHQ5TNxZM13mmWUh0wmxCl+MruKwB0VUQ4sKULreD5HETvTllDnJ6uK3QR4mxqsho6sNElhhSsAdZMQKoK+ZrlZe++EXDotyIDGmyo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777979558; c=relaxed/simple; bh=WHKvVIoXVJZrsd+0SbyoPwk8/Ew6GceIjITrUQGDZmo=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=GkfsoDZq+cOyzcoNKn3CpkZvjFHqmUT8P4DFVXeAXx6b5ozO0P6m1W8gy1q2XP4uM2LYrIY7jW5HJ48Zzv1T5i4vgvqAElYxwEX90Rqz+/WK/WZOHtx/IeRpDhpuvwLzNVZXNAuk3ltmT56uXiwUBh9wTeOu+YqY9C+J27pJ9Cw= 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.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-ot1-f70.google.com with SMTP id 46e09a7af769-7dcda136050so8235598a34.2 for ; Tue, 05 May 2026 04:12:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777979555; x=1778584355; 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=b63qcEp/QzfN8wyTegELb2Yuk7YHvzYwwUpx5HeqYpeiedI8ryzX945pkvR7WdP2Xz SC8p7rG0dsqU/yuY3NpGYawKJMXlYdkatMgk13gdLjkZ11le8TYlAOsr0wne8FM34AfA l097I1U2IJ4aNHRCkYJSRn7iy5HMcl3PJ/brR7FAbv3Nx8xQIeccuekuyUGH2AnYf0VN 6es+VrroxUR/+wXYpmcptKYaH9aeCPrI2Jm+ytTyzdITAN9zNTKjArlvV9MVeGalcoUp Hl1lUjc22wd1ryyjBXSSeT6Y+Q3oDTAV6KUAUqI7a5rqRVpMaGET1ZyL5cK9eUWSMpbD MOXw== X-Gm-Message-State: AOJu0Yxk5yInsR0Fsa63DR5NKjWbQJDiZZ8Lg99UMTxbFj4F+3Z/Bt4x tvxGW2bJnTRk165SYYEHwKL8owMkxRI7eQG2bbG0fs4qHP+qmv98wT8tdLw3oJEI7gkQfKCLJC7 YmDA5EU8nuWaz/igxxlZ20IzUo2vN3cwhDglNe94j8U9cXZT+Jq+agBY2xV0= 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:208:b0:684:2b28:f9a6 with SMTP id 006d021491bc7-6998d47032cmr1225027eaf.58.1777979555468; Tue, 05 May 2026 04:12:35 -0700 (PDT) Date: Tue, 05 May 2026 04:12:35 -0700 In-Reply-To: <000000000000707b50060f85bb0e@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <69f9d0a3.170a0220.59368.000d.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