From nobody Mon Feb 9 05:43:42 2026 Received: from mail-yx1-f52.google.com (mail-yx1-f52.google.com [74.125.224.52]) (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 734B53148DB for ; Fri, 23 Jan 2026 09:12:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=74.125.224.52 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769159553; cv=pass; b=MD7WUdaXZ9ryiBLFgzyflNF0vmHWQB1nkpU8ab96gzB+QLugTD39RxztDSYXhHfPbLF8wO7jyl5ghIeCpFCn422eJOlNMni2gEjgNHWFzR1x+XiAlCUk+fe/J0aWTr9hlQRhG8oqbJhASyF0uByDOBYzo4TazfWHYU9NeueRRS4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769159553; c=relaxed/simple; bh=RXGm5VrFt3x1vuu4Mmp2zIED7D9lWEgHCXh/nu+7tKg=; h=MIME-Version:From:Date:Message-ID:Subject:To:Cc:Content-Type; b=uROawf9NwN0c/jV9iwA3Al+4SoGCtt+H8TbgC7QgOn2xbECPqnIGSlVxrVZFhB94g3sK4VFcuX82NUL+xGaAJjUBoTvOEfXIMIb/2O/ur9ZJxSerASf+fltip6RqqlgyHrexrx2DpUcGJhAh31y+B9sb873/79Dqki8hzHtIApU= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=cOrHpfLh; arc=pass smtp.client-ip=74.125.224.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cOrHpfLh" Received: by mail-yx1-f52.google.com with SMTP id 956f58d0204a3-6495d592b58so626314d50.2 for ; Fri, 23 Jan 2026 01:12:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1769159551; cv=none; d=google.com; s=arc-20240605; b=IxUH3qwz31WCQ9vb/AJckPVe06TwFldcGVPTFgXf9rsCyxTDHiCJbEc7W68SZqrc44 l2OBHvXXgBUIUi/UXg2UT8AUild3F78ApPp1mfpnd1f5CPX76rmau0r2NiTpmjfgaJq1 fvP96wCdMDgSsfk75TDKdamgALV6iU1Sx/7HqluYUapNzTDWmjVUMBIr6ahJ/Gkki1G2 2WpWnubpgdOqhM5EU1Q4shSe6zp3lFMJs1HpsYbap7SdRKMUrY/cSJhukosS+cD01wDb kS6n8cWKnchyraZ06u/Sd55PPJv+wnN/aWw9uZQ96CmgNx0dP330oZ63DeefVe/lpXVC jFuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:mime-version:dkim-signature; bh=UYjjSXoZ8KY4OISrpWK9jrnnKzhKIHB6meD+8H3qiYU=; fh=C9II4trZhs4OomYrqLzq2EkbP00yLGth0K1//kwCZRk=; b=bKDWz4T95j9NTt3mOlpnqOQXnRH7espqVNwdOemoT0AqATSqX+YvU/I8qbCQvO8CSO e6oQk1LhxfuMPmrMomhCF4e2nZk0OrQocc4L6hMHosu3cxlwhNWPuPk+1TrfUYVlNJJh hykmWNDjzI6WVR1Vy5RC65yGF8IC7+0/l7jypqZY1gZ6R4sov4LCT4rNECX8iOUuCiHd 9QOgOGGZPgNI74r5A9FKp1NHHlQdGa7xJn7+JXhTpd5RCK98YsijYHRAoR89xHT6eojJ CCubol9Ot19zgr2eQOk9xm3Xgfnx2IGZJKVdpq+E3i2QN1Oriidi2FibAEMQwB1RyHWd OqJg==; darn=vger.kernel.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769159551; x=1769764351; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=UYjjSXoZ8KY4OISrpWK9jrnnKzhKIHB6meD+8H3qiYU=; b=cOrHpfLhX1At99yKw8ypd+mj6vOns8xd7iJu+miZUB2uwG6yhrp1L0pFlS1XoPwiNr KjSrNajIz2JKjrjj9ivydGrKPZrVI0UJTzOvrDY++fCJsYwJotb0PhspD/Qg/cZYlR3X BDvub7vV6XIjgAGakonIygg9czJTb5Nrb6MxVP3Yj3QdEqvv7ukwArlBAIh1KpfNgsUe 72Ds0pnlaW/5yz7TdMTxXt/lQi1IA/9v+ukGnIak0yPRlcs2qmFdYyC7LEGpTwFd6ljn b8CzC0+weQOivCh9ERgrQIjmx925jc5CD6OpbmkeiNof4ggCpP1KO2CwxrHjqsNCQthC vCaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769159551; x=1769764351; h=cc:to:subject:message-id:date:from:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=UYjjSXoZ8KY4OISrpWK9jrnnKzhKIHB6meD+8H3qiYU=; b=R2y2B7n3oswBSVK/Y8/CjrJjwnmP6LsggZmFn/iZGA8K5jrXOs90/NHOohb+d1nqxI K89tX2uMYmB3AVZhKwi0kBZVp0UwqBRQEkenYMj1raysw9JG8hJuVmDrZ7YYS8G2T+XS oH/ljqJcZQr+mK3U5bz2Oje0ZLbaqbQOfV+NrTBuBzh8ISPxQ9o5yD8PgO2Tuv7KvBiP MfUVQX+btT41bdhorr+dhymw74UIueBCz0s+1Pka3j6mopc7O7rle82oes9WXOZb7cZv dI8fEKl4UNpE/qwAHWcKw4aBrMBKgRkNV7h7Gi+gAFOPxJ3kXryPJzOUKi/a6VWMTAAI KShA== X-Forwarded-Encrypted: i=1; AJvYcCWmNIqFYU3Bze1iyTDoDbBrRVu5USw+IUy/CNwcvIlcodpu3IOuwXALVATJACeyg+baOT/x3tUmAF37teo=@vger.kernel.org X-Gm-Message-State: AOJu0YwHvXOTO30hT4igohXZUq4jqObLPKe+rklgyi0JnRcQzlYospaz 5Rpl/COE3l58NCHhPJFULIb7v7YuFE+e6L8ogB3j7o0I8CeSbObaLGWulWNy0HNwkeba7ZdLc26 +J+X7SIs/b73QWXbQk0HnYE4cbH/xzFc= X-Gm-Gg: AZuq6aI7lMokLn0ePPZVWBCMDFfm21LF9gGj6nvZw60heybIc8NuBhwC5H14wDBcGLO xV00Wqy7tYNv/a6KbKClzIgseOXfq80dl/j0C9kSFgra05RKzQ6AIirVKuNHgRdslQ01YV96wB3 UU4RNrfrRGRJm9FptFB86lV6+RIzGVTWqtCBE+aG4/VfLhBs65XXN5Hd4MybjkFbCn0cxZMtthG sgJziohRCRcDU9Xbv2fwW/fBYMyqzTUywLYsV68mhfdNfTOtImpRwwUCraFS0bxnxskNwsT0EYR LCO+Ts+t4Hu1oirW9vYs7zWvGSNHzvcze1U1cQHcwusgOjRGhTYpzBuLiwxuDyU7/itPtaA= X-Received: by 2002:a05:690e:1243:b0:649:518d:94db with SMTP id 956f58d0204a3-6496125f49bmr398699d50.68.1769159551356; Fri, 23 Jan 2026 01:12:31 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Deepanshu Kartikey Date: Fri, 23 Jan 2026 14:42:20 +0530 X-Gm-Features: AZwV_Qi8Ck6N1WoTmHsK8fgXgfEREZVk9mtUw1L-EImZAmGU-QQ5-yL2Q7EQTxs Message-ID: Subject: Subject: [PATCH RFC] jfs: fix KMSAN warning in txLock - need guidance To: shaggy@kernel.org, brauner@kernel.org Cc: ssrane_b23@ee.vjti.ac.in, mjguzik@gmail.com, jfs-discussion@lists.sourceforge.net, "linux-kernel@vger.kernel.org" , syzbot+d3a57c32b9112d7b01ec@syzkaller.appspotmail.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Hi JFS maintainers, I'm investigating a KMSAN warning reported by syzbot: https://syzkaller.appspot.com/bug?extid=3Dd3a57c32b9112d7b01ec The KMSAN trace shows uninitialized memory being read in txLock(): BUG: KMSAN: uninit-value in txLock+0x13a2/0x2900 fs/jfs/jfs_txnmgr.c:659 Uninit was created at: vmalloc_noprof+0xce/0x140 mm/vmalloc.c:4146 txInit+0xb5c/0xfa0 fs/jfs/jfs_txnmgr.c:297 The issue is that txInit() allocates the global TxLock array using vmalloc(), which doesn't zero the memory. When txLock() later accesses TxLock[].next fields, it reads uninitialized memory. I have a simple fix - changing vmalloc() to vzalloc() in txInit(): diff --git a/fs/jfs/jfs_txnmgr.c b/fs/jfs/jfs_txnmgr.c index c16578af3a77..4c72103a0b46 100644 --- a/fs/jfs/jfs_txnmgr.c +++ b/fs/jfs/jfs_txnmgr.c @@ -294,7 +294,7 @@ int txInit(void) * tlock id =3D 0 is reserved. */ size =3D sizeof(struct tlock) * nTxLock; - TxLock =3D vmalloc(size); + TxLock =3D vzalloc(size); if (TxLock =3D=3D NULL) { vfree(TxBlock); return -ENOMEM; This fixes the KMSAN warning. However, when testing with the reproducer, this change exposes a different issue: [ 307.772029][ T6674] BUG at fs/jfs/jfs_txnmgr.c:662 assert(last) It seems that with zeroed memory, the assert at line 662 now fails because the code is trying to traverse a transaction lock list starting from atlhead=3D0, and TxLock[0].next is now 0 (instead of garbage). I believe my vzalloc() patch is correct - it fixes undefined behavior. The assert failure appears to be a separate pre-existing logic bug that was previously hidden by garbage memory values. Questions: 1. Is my analysis correct? 2. Should I submit just the vzalloc() patch? 3. Should the assert be replaced with proper error handling? 4. Is there a case where atlhead=3D0 is valid and the code should handle it? I'm a kernel newbie and would appreciate guidance on the right approach. Thanks, Deepanshu Kartikey