From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oa1-f70.google.com (mail-oa1-f70.google.com [209.85.160.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 12F0E39EF3F for ; Thu, 30 Apr 2026 22:41:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.70 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777588897; cv=none; b=F1Gp30XGzr6LLZ3z87gTi4cXan0Dnmh7A+dtr+PCO3jinlwaeZZPcftlKgo2ODmYEixFknYkEbKkGinx/9vHFb5FWSdu6tZxyFSBWC6AhQjD4fNlYxhk9gOlCQZ1awLfvAUJCS5rSdBUMmf/6rGt09Qq1K3+KMjZn3BgVTYALTo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777588897; c=relaxed/simple; bh=3N0Reby6ycqQV6UCO5ROOxvof0g7ZfRHGqWABZkA9KI=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=Z9Y3LLzj5u/x4jhdGIJSizH7pyG0U2IpC3tjuVU4gqyMM23LgwXKCmNC9zCRbwy5WzUQ4N5W0Aw0OOB45iEqXD63kReKo0fQvQ1mh232dAFX9Ru82xjCM7kRDqekaJVNTCt3gZzTXHqAP74FxMwGEmluv5ai8Q8RFd+4bpXNFU8= 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.160.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-oa1-f70.google.com with SMTP id 586e51a60fabf-42fb973b2a2so1940570fac.1 for ; Thu, 30 Apr 2026 15:41:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777588895; x=1778193695; 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=CnulBsuq/xkfSRRk9BP9HA6zgCKpk/agdSANeTgDw3k=; b=MM3FC11sS5h8rQMbhyoPYceNcsG6C2cNwfKEZ6HiHxtbaNFXilgcPCFptw1/6NYZR8 invAhN3bRP6ZXZNLG+Bx/sWf2UP0PiRwOoKAeubF0lSFVZ8O6MkI5R17lh0SEZ5D0gJL Z1OdJzcenNQTKYM+4ERxNIeJdz+X79LS9AxEXGt2akGLFkgUmgENBGUTsXmWwZg4dgcs 1rglZTftjTy2sXOUlyj4WjAItkZMurLu74gdPVuR5PFkdvYMY38VUzhQqUtl3OuQXeBv WQJE/PWyEE5lsU1zYaTGzvddmb00dE0WtInenc9lTF427klSs7LHo54hzF3dTXh9TtpF Hr+w== X-Gm-Message-State: AOJu0YwPcvfnfbYCEaXC841RaVKbXUsny4PSj03m2yUWx7SM2HPVY4tj 9GmdCBte1WnkWrtpQHCg6r13OGEh9S2JkHiWayISHLRBaExLVAEdPBNm3oT0xOqf1lt8uaJnGw1 e24fi7KwYXxrANfrs0xnBCwEnew90EiNKkp4EHm11rLQ1Qq7Tk0ZOesPyT24= 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:2086:b0:696:1fae:fb83 with SMTP id 006d021491bc7-6967a5a88f3mr2758160eaf.34.1777588895062; Thu, 30 Apr 2026 15:41:35 -0700 (PDT) Date: Thu, 30 Apr 2026 15:41:35 -0700 In-Reply-To: <0000000000002a358205ee5b22d8@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <69f3da9f.050a0220.312cd3.0003.GAE@google.com> Subject: Forwarded: Re: [syzbot] [hfs?] KASAN: slab-out-of-bounds Read in hfsplus_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] [hfs?] KASAN: slab-out-of-bounds Read in hfsplus_bnode_read 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