Re: [syzbot] [kernfs?] possible deadlock in kernfs_fop_llseek

From: Hillf Danton
Date: Wed Apr 03 2024 - 22:13:23 EST


On Wed, 03 Apr 2024 11:23:26 -0700
> syzbot found the following issue on:
>
> HEAD commit: fe46a7dd189e Merge tag 'sound-6.9-rc1' of git://git.kernel..
> git tree: upstream
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=15c38139180000

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git fe46a7dd189e

--- x/fs/overlayfs/util.c
+++ y/fs/overlayfs/util.c
@@ -1159,9 +1159,8 @@ int ovl_nlink_start(struct dentry *dentr
return err;
}

- err = ovl_inode_lock_interruptible(inode);
- if (err)
- return err;
+ if (!mutex_trylock(&OVL_I(inode)->lock))
+ return -EBUSY;

err = ovl_want_write(dentry);
if (err)
--