Lines Matching refs:idmap
27 * @idmap: idmap of the mount @inode was found from
37 int setattr_should_drop_sgid(struct mnt_idmap *idmap,
46 if (!in_group_or_capable(idmap, inode, i_gid_into_vfsgid(idmap, inode)))
55 * @idmap: idmap of the mount @inode was found from
67 int setattr_should_drop_suidgid(struct mnt_idmap *idmap,
77 kill |= setattr_should_drop_sgid(idmap, inode);
88 * @idmap: idmap of the mount @inode was found from
92 * If the inode has been found through an idmapped mount the idmap of
93 * the vfsmount must be passed through @idmap. This function will then
94 * take care to map the inode according to @idmap before checking
98 static bool chown_ok(struct mnt_idmap *idmap,
101 vfsuid_t vfsuid = i_uid_into_vfsuid(idmap, inode);
105 if (capable_wrt_inode_uidgid(idmap, inode, CAP_CHOWN))
115 * @idmap: idmap of the mount @inode was found from
119 * If the inode has been found through an idmapped mount the idmap of
120 * the vfsmount must be passed through @idmap. This function will then
121 * take care to map the inode according to @idmap before checking
125 static bool chgrp_ok(struct mnt_idmap *idmap,
128 vfsgid_t vfsgid = i_gid_into_vfsgid(idmap, inode);
129 vfsuid_t vfsuid = i_uid_into_vfsuid(idmap, inode);
136 if (capable_wrt_inode_uidgid(idmap, inode, CAP_CHOWN))
146 * @idmap: idmap of the mount the inode was found from
156 * If the inode has been found through an idmapped mount the idmap of
157 * the vfsmount must be passed through @idmap. This function will then
158 * take care to map the inode according to @idmap before checking
165 int setattr_prepare(struct mnt_idmap *idmap, struct dentry *dentry,
187 !chown_ok(idmap, inode, attr->ia_vfsuid))
192 !chgrp_ok(idmap, inode, attr->ia_vfsgid))
199 if (!inode_owner_or_capable(idmap, inode))
205 vfsgid = i_gid_into_vfsgid(idmap, inode);
208 if (!in_group_or_capable(idmap, inode, vfsgid))
214 if (!inode_owner_or_capable(idmap, inode))
223 error = security_inode_killpriv(idmap, dentry);
280 * @idmap: idmap of the mount the inode was found from
293 * If the inode has been found through an idmapped mount the idmap of
294 * the vfsmount must be passed through @idmap. This function will then
295 * take care to map the inode according to @idmap before checking
303 void setattr_copy(struct mnt_idmap *idmap, struct inode *inode,
308 i_uid_update(idmap, attr, inode);
309 i_gid_update(idmap, attr, inode);
318 if (!in_group_or_capable(idmap, inode,
319 i_gid_into_vfsgid(idmap, inode)))
326 int may_setattr(struct mnt_idmap *idmap, struct inode *inode,
344 if (!inode_owner_or_capable(idmap, inode)) {
345 error = inode_permission(idmap, inode, MAY_WRITE);
356 * @idmap: idmap of the mount the inode was found from
375 * If the inode has been found through an idmapped mount the idmap of
376 * the vfsmount must be passed through @idmap. This function will then
377 * take care to map the inode according to @idmap before checking
381 int notify_change(struct mnt_idmap *idmap, struct dentry *dentry,
392 error = may_setattr(idmap, inode, ia_valid);
473 !vfsuid_has_fsmapping(idmap, inode->i_sb->s_user_ns,
477 !vfsgid_has_fsmapping(idmap, inode->i_sb->s_user_ns,
485 !vfsuid_valid(i_uid_into_vfsuid(idmap, inode)))
488 !vfsgid_valid(i_gid_into_vfsgid(idmap, inode)))
491 error = security_inode_setattr(idmap, dentry, attr);
499 error = inode->i_op->setattr(idmap, dentry, attr);
501 error = simple_setattr(idmap, dentry, attr);
505 ima_inode_post_setattr(idmap, dentry);