linux/fs/crypto
Zhan Xusheng cf6c993c0f fscrypt: use the mount idmap for the owner check in fscrypt_ioctl_set_policy()
fscrypt_ioctl_set_policy() calls inode_owner_or_capable() with
&nop_mnt_idmap before allowing an encryption policy to be set, instead
of the idmap of the mount the ioctl was issued on.

fscrypt is used by filesystems that support idmapped mounts (e.g. ext4,
f2fs), so on such a mount this compares the caller's fsuid against the
unmapped on-disk owner rather than the mapped owner: the actual owner
can be wrongly denied with -EACCES and an unrelated caller wrongly
allowed.  Use file_mnt_idmap(filp) instead.

Fixes: 14f3db5542 ("ext4: support idmapped mounts")
Cc: stable@vger.kernel.org
Signed-off-by: Zhan Xusheng <zhanxusheng@xiaomi.com>
Link: https://patch.msgid.link/20260725080004.929328-1-zhanxusheng1024@gmail.com
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
2026-07-28 21:19:44 -07:00
..
bio.c fscrypt: pass a real sector_t to fscrypt_zeroout_range 2026-03-09 13:34:21 -07:00
crypto.c treewide: change inode->i_ino from unsigned long to u64 2026-03-06 14:31:28 +01:00
fname.c fs: add helpers name_is_dot{,dot,_dotdot} 2026-01-29 10:06:59 +01:00
fscrypt_private.h fscrypt: Replace mk_users keyring with simple list 2026-06-22 12:12:11 -07:00
hkdf.c fscrypt: use HMAC-SHA512 library for HKDF 2025-09-05 21:01:51 -07:00
hooks.c treewide: change inode->i_ino from unsigned long to u64 2026-03-06 14:31:28 +01:00
inline_crypt.c fscrypt: Avoid dynamic allocation in fscrypt_get_devices() 2026-07-20 10:39:24 -07:00
Kconfig fscrypt: use AES library for v1 key derivation 2026-03-25 12:06:33 -07:00
keyring.c fscrypt: Replace mk_users keyring with simple list 2026-06-22 12:12:11 -07:00
keysetup_v1.c fscrypt: Add missing superblock check in find_or_insert_direct_key() 2026-07-20 10:39:24 -07:00
keysetup.c fscrypt: Fix key setup in edge case with multiple data unit sizes 2026-06-22 12:12:11 -07:00
Makefile fscrypt: add inline encryption support 2020-07-08 10:29:30 -07:00
policy.c fscrypt: use the mount idmap for the owner check in fscrypt_ioctl_set_policy() 2026-07-28 21:19:44 -07:00