From nobody Mon Feb 9 07:31:49 2026 Received: from mail-yx1-f41.google.com (mail-yx1-f41.google.com [74.125.224.41]) (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 A6C34224AFA for ; Fri, 23 Jan 2026 09:10:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=74.125.224.41 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769159419; cv=pass; b=NSux+ExYcaVueBk059fsZ5PNf98xWvFxM50L3+mRRAbMevtndHBSpm9CsHuCaJzB+9k8LQ458Ba3upbGeAMF7S5eciXArcH5qPAVsNhxRTDzM0nRqLoiLFIkBcGIA+qwIOWe/gVqyYFKfWMYWNdkNsL6ZnmX0efiZ30hMcx9xDI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769159419; c=relaxed/simple; bh=RXGm5VrFt3x1vuu4Mmp2zIED7D9lWEgHCXh/nu+7tKg=; h=MIME-Version:From:Date:Message-ID:Subject:To:Cc:Content-Type; b=GjFQH4AQeliImoDIU9bgG0cvs1HwUEN9gT2lx92LYJejdTPxFc93tZzTAMM1v/V+ZwiBSKr6KAm0qjyc68WNKtyCB+KkNlwklaB3G6YHEv0EZ6fa+bE/iZG1hmDR9YxryLlcfk558AHGd98YAY6ZAb1ejT4B2TGMvFbXETaT92M= 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=EFtwn4FI; arc=pass smtp.client-ip=74.125.224.41 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="EFtwn4FI" Received: by mail-yx1-f41.google.com with SMTP id 956f58d0204a3-6493937c342so2095876d50.1 for ; Fri, 23 Jan 2026 01:10:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1769159416; cv=none; d=google.com; s=arc-20240605; b=EeSOjG6JC0vDenRS4xyeoakaRoiALLCBNGQKr8RY45W50i5oLGKvUeT/q3J4rK+wID EtRkwJ71WFUDcJy3iheqzK5psU2/C6pLpEzx7I8WdoB5adFGDq8crF3j5LLu1deGRapO tC8LBE5CA2DYcbpNE+lE4RJM1YIUgwlf6hSfWNbUaGDdHopunH4tuuVi/nE0+eqeDZRz am7XnTpwvhLu+E6ph4O94JYVLiUuRP7I1AqAcb5uGH8n3FKvU5UHgQ9NxQ9JvWcb5aL9 5k2ZbcNlz7J9Z4H8422elIgqHpCelbkyq8zQPlc/jSs6a3LkxdAyVds+0FQHlW+PGBVE hwDA== 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=I6ygWUJdjyS1HSP4wooACfy1Wk9ZNUAMEspEpLnxorg=; b=N/4/kqpIFSY+0VUP8yfs36Nyg1pJ/oaUJ1+62ioY7dVNVJot8F9pmieRCF0PCDdehs eaIyWWdGi3mKYepHu/NuMvCqyTr2MsfyfDM+gGl8VK139PrjiBrmLC3vg867zAe7Rw/z Ry8kY0+GFHx2+1T90hVH60WK/BWen2fwtTnM5jRdjHXSuwg3nIgVPT52Xxp/7Lt4LM85 U69maHVZ957GGOYCfbfPW0GvX0G8ovjJvt0F7tCFiq3DschCrWEL0OR5+jON/WkfIvH5 p9cw+QyP3XPSrv6Ukjf9AYWC3eghjEjyZBxFtT5GqYHEbvXsqO+M3daWyVgPQe+aT2ab +XAQ==; 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=1769159416; x=1769764216; 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=EFtwn4FIzmfrUQosZ1xFLXfwGM48PChOItuYiRI3Xj+N4+lEKF2TdHtHUObRfS3pg1 0oXNe4BMMtJYIBQS082neDG5VFgn6EojhhjzOyh8Cj07rUfebuJ4ESfsCo60PmsFf3FU g8Rkev4PcgUg7lfa/rb66GVA+eksxSO19u+LxfQo3pzssd5LXBVJjdLry2Lxlhk7H0Lm S5/0THOjSJ+ncHjE+ZEat3PKAP9SJiUFrmK0czmf2kJSB2gPw9N+zrvkLBxxHoAvvT9a 8PaejBzunh+Qu41EWMI1ssE2Gh89mEO0Mln7fEmjxHovZTH8W9+T1bD/fU2m367bm9oB lV7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769159416; x=1769764216; 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=r9hamjUFiWNEsdtFqKGC8Dro4KDv+xTivsa94h6dNb8k9ngccyyedgLuTbsXpIYqN4 7/RFHvn8dQgfA07sKq12jf8mRUnmx/IPmWEugtoQessoYr0QqTEd372qf1e7L9AD0/ur sAJDaA8a7NbCjAwQ9qR0SWDYNm66NW36rsiiagDhM/TeoTLM961DarBuZ+lQHVuufHLv pTWawjMIPlYcOYBO03UTE6oIJW6IAAnukLIKZoWVGK4lnwBrgCsfWQriroeszd5rAFh9 haIKBwltNhn4WskfrxnoAGHxQJmGQSV67+phbvCQYS2K9lK72g8s2Wqbzq6pMnN0gdqq BAbg== X-Forwarded-Encrypted: i=1; AJvYcCWbfNW4VLSMBSMvOYERi4Pz3ya02naSh2pcnFohjM3JDvRVT5Ums6RPLQqty0OV9ut1t1RuYm/E2g0g0V0=@vger.kernel.org X-Gm-Message-State: AOJu0YyQMVe1/qfv+oBpC4DExRkoQ45DXDfXt929zMUxazxypE43YW6J 6pCnYZJu0qm8M+UrPstHZfxZlLTg04mEwCydmU4xH+H1eUR2HkVz3OvPYiH/3blDxXq16ldVHsk gVpeqtl4D8mQJLDraeGJDI6le2P+P60g= X-Gm-Gg: AZuq6aLNUPn2gbJm7i1+LR4MfSYFP+lC5TPiyjiaG5DXUCei83D+8Y39MCatvUF0Vz4 jJhd52fUOeLrUZzhO+GA4PSI70mJF+Zkb024BTJdLwfbJqfvEEeR8RI18QrOA53sZ9FkLPPeHOV v7cPK5DkC+VzPQF90SkLia3lTUm5FjUDcZ0DHIs20s6X5jMySJRe5GLB/aUcBIoHmPLkHpilBmI 3hPIb1srDsq4TfXbjESvUFoJ8zb4pUPtcnl+OBZ9T6zdjgOuOwOixQSS1M574JbuefaY9OEkhMN +/ieIxeRQc5PvVnSPFMSbFjhEutqUhufWvf3/Zh8+Zs05ArqVLUkM+XpvKi1+omB8eqCqTA= X-Received: by 2002:a05:690e:4104:b0:646:e67f:e97b with SMTP id 956f58d0204a3-6495bee640emr1858729d50.15.1769159416547; Fri, 23 Jan 2026 01:10:16 -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:40:04 +0530 X-Gm-Features: AZwV_QjIHLHPx4uo1REzsszw2s_18e1VyetyS15NycztdxDFXjnuSXD2lBlQidI Message-ID: Subject: [PATCH RFC] jfs: fix KMSAN warning in txLock - need guidance To: shaggy@kernel.org, brauner@kernel.org Cc: jfs-discussion@lists.sourceforge.net, "linux-kernel@vger.kernel.org" , mjguzik@gmail.com, b23@ee.vjti.ac.in 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