fscrypt: use the mount idmap for the owner check in fscrypt_ioctl_set_policy()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 14f3db5542e62bcf6fe088a09760ac52d55306c5 · < 98516ba8b817f34e86bdd7a5b7a383cff75c3ddf| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
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.
From the CVE record · Linux
On an idmapped mount, the fscrypt policy-setting ioctl checks ownership against the on-disk owner instead of the mapped owner. A local caller using the ioctl can be wrongly allowed to set an encryption policy, while the actual owner can be wrongly denied.
Anyone running the Linux kernel with filesystems that support fscrypt and idmapped mounts should check whether their kernel is affected; affected versions were not provided.