mirror of
https://github.com/torvalds/linux.git
synced 2024-11-13 07:31:45 +00:00
fs.vfsuid.fat.v6.1
-----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRAhzRXHqcMeLMyaSiRxhvAZXjcogUCYzqjGgAKCRCRxhvAZXjc ovVFAQCbZXflZk/DGy1CVEWHwJDkMlmN62jCY+3gZP6UPsCeCQEA4uB3Hub7jihO b2q9yhR+p6G7DHkeNAo2qUu4bI0lDgQ= =zG6Z -----END PGP SIGNATURE----- Merge tag 'fs.vfsuid.fat.v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/idmapping Pull fatfs vfsuid conversion from Christian Brauner: "Last cycle we introduced the new vfs{g,u}id_t types that we had agreed on. The most important parts of the vfs have been converted but there are a few more places we need to switch before we can remove the old helpers completely. This cycle we converted all filesystems that called idmapped mount helpers directly. The affected filesystems are f2fs, fat, fuse, ksmbd, overlayfs, and xfs. We've sent patches for all of them. Looking at -next f2fs, ksmbd, overlayfs, and xfs have all picked up these patches and they should land in mainline during the v6.1 merge window. So all filesystems that have a separate tree should send the vfsuid conversion themselves. Onle the fat conversion is going through this generic fs trees because there is no fat tree. In order to change time settings on an inode fat checks that the caller either is the owner of the inode or the inode's group is in the caller's group list. If fat is on an idmapped mount we compare whether the inode mapped into the mount is equivalent to the caller's fsuid. If it isn't we compare whether the inode's group mapped into the mount is in the caller's group list. We now use the new vfsuid based helpers for that" * tag 'fs.vfsuid.fat.v6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/idmapping: fat: port to vfs{g,u}id_t and associated helpers
This commit is contained in:
commit
8bea8ff34a
@ -461,8 +461,9 @@ static int fat_allow_set_time(struct user_namespace *mnt_userns,
|
||||
{
|
||||
umode_t allow_utime = sbi->options.allow_utime;
|
||||
|
||||
if (!uid_eq(current_fsuid(), i_uid_into_mnt(mnt_userns, inode))) {
|
||||
if (in_group_p(i_gid_into_mnt(mnt_userns, inode)))
|
||||
if (!vfsuid_eq_kuid(i_uid_into_vfsuid(mnt_userns, inode),
|
||||
current_fsuid())) {
|
||||
if (vfsgid_in_group_p(i_gid_into_vfsgid(mnt_userns, inode)))
|
||||
allow_utime >>= 3;
|
||||
if (allow_utime & MAY_WRITE)
|
||||
return 1;
|
||||
|
Loading…
Reference in New Issue
Block a user