From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f70.google.com (mail-oo1-f70.google.com [209.85.161.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 2492131F987 for ; Tue, 5 May 2026 11:12:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.70 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777979574; cv=none; b=HcPqA+t/57G3LYf90lkTCeK8D+KNiR/L/Iir5tnIL8km35ash3bbQJU4V/BYGAAOpeAT76BK5KCArr7xJ1SvvqbYjDbc+o2RqQSHRHP/eXDG+2iKrpAhLbYujwyigV6u3/BMmL7BVMdAb4oOCrvWcaAY/zHCTZBUVdhekcEWgSc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777979574; c=relaxed/simple; bh=qUIhV96Ygwgh0iVA/e5jkwHoJjvbrsBJZI0+oZAL1iA=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=RblDk5l0XE+uyshOpslfZeFRLqLH69ntLKCAyDZnVRUYWKlLPlfmrYnZzXljZpveBQI1mMqi9HBLJgFnE4fLytAniraqX4mYunAnYJ4ON+yErFUT/TY+1UhCXlnAMWsY5b5p3urVRtM2i6VthBmcaBuNQSJDj/9Gugy3hRuekBM= 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.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-oo1-f70.google.com with SMTP id 006d021491bc7-6853c2438b9so9587502eaf.3 for ; Tue, 05 May 2026 04:12:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777979572; x=1778584372; 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=hOh+qYcuTm7j/wK4E/Bjp0WhprhsvlLBJHLDDiAM8sQ=; b=hfcRm5tj596ozfPI/5lbRhDOIivQyeT1Loyxnz7PYTEv0nfwfGsWJ25zlsqsjbaWm2 C1oi+bQBg53eeLAMOAfRBqgKy4ZNLFLhk6Qohh5I3+Jgmqoe4oIYKPWx1Uz1zal7wvSx f7qNuSAbOnZmU86yl+mT6lQHKV6Bk5owNRnIaF+pdZfBHrRAKa7cD804x4+zOxPFtSIu gJyFaSifl18bBcTwRUmJyCIyQd87WWhnXxoaMreWq/8FSybmalGoIsg6wrVE6IVcKVKa 9IhU2R/LAlm5yLW1AA+KY7545uMzviLjU6sfm1sP72pPuXAj1GNeZ4/uSCNLWNbbbdFS upwA== X-Gm-Message-State: AOJu0Yxv9N4RAu/0mBm7VrxBbdxhS++LTZPhlIp3VbscdGf61YcLShjs w5udqEmkAwOqYPFsalcArChctCUNuiNcFfmntHajchtDVWrj5rEPBaIuF/Ox6atAWeMP6mDn2nr f4sNrCdOvpHLiNX0t5cBMNG14c1TCKQGTw7Wb/3pmP9hyOc8erUkfPzaaCfI= 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:1606:b0:696:21ad:a4e9 with SMTP id 006d021491bc7-6998a5a87dbmr1136646eaf.13.1777979572089; Tue, 05 May 2026 04:12:52 -0700 (PDT) Date: Tue, 05 May 2026 04:12:52 -0700 In-Reply-To: <69decbd0.a00a0220.468cb.006b.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <69f9d0b4.050a0220.e8b39.0001.GAE@google.com> Subject: Forwarded: Re: [syzbot] KMSAN: uninit-value 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] KMSAN: uninit-value in hfs_bnode_read Author: tristmd@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master >>From 9844dc36acf6c4c44348a5ea5ece3367423b0519 Mon Sep 17 00:00:00 2001 From: Tristan Madani Date: Tue, 5 May 2026 11:08:43 +0000 Subject: [PATCH v2 2/2] hfs/hfsplus: zero-initialize buffer in hfs_bnode_read hfs_bnode_read() can return early without writing to the output buffer when is_bnode_offset_valid() fails or when check_and_correct_requested_ length() corrects the length to zero. Callers such as hfs_bnode_read_ u16() and hfs_bnode_read_u8() pass stack-allocated buffers and use the result unconditionally, leading to KMSAN uninit-value reports. Rather than initializing at each individual call site, zero the buffer at the start of hfs_bnode_read() before any validation checks. This ensures all callers in both hfs and hfsplus get a deterministic zero value regardless of which early-return path is taken. Reported-by: syzbot+217eb327242d08197efb@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=217eb327242d08197efb Tested-by: syzbot+217eb327242d08197efb@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/bnode.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/fs/hfs/bnode.c b/fs/hfs/bnode.c index 9571f33b91085..25cef62fbba6d 100644 --- a/fs/hfs/bnode.c +++ b/fs/hfs/bnode.c @@ -64,6 +64,8 @@ void hfs_bnode_read(struct hfs_bnode *node, void *buf, u32 off, u32 len) u32 bytes_read; u32 bytes_to_read; + memset(buf, 0, len); + if (!is_bnode_offset_valid(node, off)) return; diff --git a/fs/hfsplus/bnode.c b/fs/hfsplus/bnode.c index f8b5a8ae58ff5..14d1af2c7ba93 100644 --- a/fs/hfsplus/bnode.c +++ b/fs/hfsplus/bnode.c @@ -25,6 +25,8 @@ void hfs_bnode_read(struct hfs_bnode *node, void *buf, u32 off, u32 len) struct page **pagep; u32 l; + memset(buf, 0, len); + if (!is_bnode_offset_valid(node, off)) return; -- 2.47.3