Re: [PATCH 07/12] zloop: take freeze protection when recording write pointers
From: Jan Kara
Date: Mon Nov 16 2026 - 06:57:31 EST
On Mon 16-11-26 10:41:49, Christian Brauner wrote:
> Fwiw, the check can't go into __vfs_setxattr(), __vfs_setxattr_noperm()
> or __vfs_removexattr(). cap_inode_killpriv(), IMA and EVM call those
> from ->write_iter() via file_remove_privs() and kiocb_start_write()
> hides the freeze protection from lockdep for aio and io_uring. I have
> not bothered to figure out why. Maybe you already know? In any case,
> until that's fixed we can't place it there which means this doesn't
> catch IMA/EVM at which point this patch becomes pointless.
It's because of AIO and io_uring - if you don't hide the protection from
lockdep, it will complain about it when returning to userspace while IO is
still in flight (and thus protection is held). Sadly lockdep does not
support releasing resources by anybody else than the process which acquired
it so we fool it in this way...
Honza
--
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR