[PATCH] ima: key iint mutex lockdep class per filesystem type
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Mon Nov 23 11:20:44 UTC 2026
> syzbot reports a circular locking dependency between the iint mutex,
> a 9p inode's i_rwsem and the sb_writers of the cachefiles backing fs:
>
> sb_writers#12 --> &ima_iint_mutex_key[depth] --> &sb->s_type->i_mutex_key#25
>
> The three edges are:
>
> backing fs O_TRUNC open: sb_writers(backing) -> iint(backing inode)
> 9p open + IMA hash: iint(9p inode) -> i_rwsem(9p inode)
> 9p truncate/writeback: i_rwsem(9p inode) -> sb_writers(backing)
>
> The last one is inherent to netfs: it writes to its cachefiles backing
> file under its own inode lock. The cycle only closes because the iint
> mutex is keyed by s_stack_depth alone, so the 9p and backing fs iints,
> both at depth 0, share one lockdep class. They are different inodes
> and nothing waits on a netfs iint while holding the backing fs's
> sb_writers, so this is a false positive.
>
> Key the iint mutex per filesystem type as well as depth, as is done for
> i_rwsem with s_type->i_mutex_key. The overlayfs case covered by the
> depth annotation is unchanged.
>
> Fixes: e044374a8a0a ("ima: annotate iint mutex to avoid lockdep false positive warnings")
> Reported-by: syzbot+deb8af81d91415fabac1 at syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=deb8af81d91415fabac1
> Signed-off-by: Nguyen Ngoc Thang <ngocthang2710.1999 at gmail.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261123111452.237422-1-ngocthang2710.1999@gmail.com?part=1
More information about the Linux-security-module-archive
mailing list