Re: [PATCH] fs: jfs: Avoid sleeping function call in softirq
From: Al Viro
Date: Sat Mar 22 2025 - 10:36:08 EST
On Sat, Mar 22, 2025 at 07:51:34PM +0530, Purva Yeshi wrote:
> Bug detected by Syzbot:
> BUG: sleeping function called from invalid context in jfs_fsync
>
> Fix jfs_fsync() to avoid sleeping in softirq/atomic, preventing crash.
> Skip execution in softirq/atomic and return -EWOULDBLOCK to prevent issues.
> Correct generic_file_fsync() call to pass the required arguments properly.
_ANY_ ->fsync() instance may sleep; adding that bandaid in jfs one does
not fix anything - the realy bug is whatever leads to having that
*called* in such conditions (e.g. having an unbalanced spin_lock()
somewhere, etc.)
NAK.