In the Linux kernel, the following vulnerability has been resolved:
ext4: fix idatasem unlock order in ext4indmigrate()
Fuzzing reports a possible deadlock in jbd2logwait_commit.
This issue is triggered when an EXT4IOCMIGRATE ioctl is set to require synchronous updates because the file descriptor is opened with OSYNC. This can lead to the jbd2journalstop() function calling jbd2mightwaitforcommit(), potentially causing a deadlock if the EXT4IOC_MIGRATE call races with a write(2) system call.
This problem only arises when CONFIGPROVELOCKING is enabled. In this case, the jbd2mightwaitforcommit macro locks jbd2handle in the jbd2journalstop function while idatasem is locked. This triggers lockdep because the jbd2journalstart function might also lock the same jbd2handle simultaneously.
Found by Linux Verification Center (linuxtesting.org) with syzkaller.
Rule: add