CVE-2026-93252: ocfs2: fix circular locking dependency in ocfs2_init_acl()
In the Linux kernel, the following vulnerability has been resolved:
ocfs2: fix circular locking dependency in ocfs2initacl()
A lockdep warning indicates a circular locking dependency between &oi->ipxattrsem and &journal->jtransbarrier:
WARNING: possible circular locking dependency detected is trying to acquire lock: (&oi->ipxattrsem){++++}-{4:4}, at: ocfs2initacl+0x2fd/0x7e0 fs/ocfs2/acl.c:367
but task is already holding lock: (&journal->jtransbarrier){.+.+}-{4:4}, at: ocfs2starttrans+0x3ab/0x700 fs/ocfs2/journal.c:369
The deadlock involves two code paths: Path 1 (setxattr) where ocfs2xattrset() acquires ipxattrsem (write) and then starts a transaction, which acquires jtransbarrier (read); and Path 2 (mkdir/mknod) where ocfs2mknod() starts a transaction (jtransbarrier read) and then calls ocfs2initacl(), which attempts to acquire ipxattrsem (read) on the parent directory to retrieve the default ACL.
Because rwsemaphores are subject to writer priority, a pending writer on jtransbarrier (e.g., the journal commit thread) can cause Path 1 to block, while Path 2 is blocked waiting for Path 1 to release ipxattrsem.
The patch fixes the lock ordering by precomputing the ACL state before starting the OCFS2 transaction, while preserving POSIX ACL storage semantics and the existing inode/security initialization order. By reading the parent directory's default ACL and preparing the new inode's ACLs outside the transaction, ipxattrsem is always acquired before jtransbarrier.
struct ocfs2aclstate encapsulates the prepared ACL state, while ocfs2aclinitprepare() and ocfs2aclinitrelease() avoid code duplication between ocfs2mknod() and ocfs2initsecurityandacl(). ocfs2calcxattrinit() and ocfs2initacl() use this precomputed state, removing internal ipxattrsem acquisition and redundant disk reads.
Additionally, remove the ipxattrsem acquisition from ocfs2xattrsethandle(). This function is only used while initializing a new inode that has not yet been inserted into the inode hash or attached to a dentry, meaning there is no risk of concurrent access and the lock is unnecessary.
Affected Software
Event History
Frequently Asked Questions
Which systems are exposed to this locking issue?
Systems using the OCFS2 filesystem are exposed when concurrent operations exercise both paths: setting extended attributes and creating directories or device nodes where default ACLs are retrieved from the parent directory.
What conditions lead to the deadlock?
One path holds the inode extended-attribute semaphore while waiting to start a transaction, while the other holds the journal transaction barrier and waits for the extended-attribute semaphore. A pending writer on the journal transaction barrier, such as the journal commit thread, can complete the circular wait because rw_semaphores give priority to writers.
How can I tell whether the issue is occurring?
Lockdep can report a possible circular locking dependency involving &oi->ip_xattr_sem and &journal->j_trans_barrier, with ocfs2_init_acl() in the acquisition path. The affected activity involves setxattr operations together with mkdir or mknod operations on OCFS2.