]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
jfs: fix uninitialized waitqueue in transaction manager
authorShaurya Rane <ssrane_b23@ee.vjti.ac.in>
Sun, 24 Aug 2025 20:13:32 +0000 (01:43 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Dec 2025 11:45:13 +0000 (12:45 +0100)
commitd6af7fce2e162ac68e85d3a11eb6ac8c35b24b64
treea5359f85f719f52f103692ba51b7e2d6a415c809
parent19cce65709a8a2966203653028d9004e28e85bd5
jfs: fix uninitialized waitqueue in transaction manager

[ Upstream commit 300b072df72694ea330c4c673c035253e07827b8 ]

The transaction manager initialization in txInit() was not properly
initializing TxBlock[0].waitor waitqueue, causing a crash when
txEnd(0) is called on read-only filesystems.

When a filesystem is mounted read-only, txBegin() returns tid=0 to
indicate no transaction. However, txEnd(0) still gets called and
tries to access TxBlock[0].waitor via tid_to_tblock(0), but this
waitqueue was never initialized because the initialization loop
started at index 1 instead of 0.

This causes a 'non-static key' lockdep warning and system crash:
  INFO: trying to register non-static key in txEnd

Fix by ensuring all transaction blocks including TxBlock[0] have
their waitqueues properly initialized during txInit().

Reported-by: syzbot+c4f3462d8b2ad7977bea@syzkaller.appspotmail.com
Signed-off-by: Shaurya Rane <ssrane_b23@ee.vjti.ac.in>
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/jfs/jfs_txnmgr.c