Loading fs/open.c +1 −1 Original line number Diff line number Diff line Loading @@ -456,7 +456,7 @@ static int chmod_common(struct path *path, umode_t mode) if (error) return error; mutex_lock(&inode->i_mutex); error = security_path_chmod(path->dentry, path->mnt, mode); error = security_path_chmod(path, mode); if (error) goto out_unlock; newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO); Loading include/linux/security.h +3 −7 Original line number Diff line number Diff line Loading @@ -1435,8 +1435,7 @@ struct security_operations { struct dentry *new_dentry); int (*path_rename) (struct path *old_dir, struct dentry *old_dentry, struct path *new_dir, struct dentry *new_dentry); int (*path_chmod) (struct dentry *dentry, struct vfsmount *mnt, umode_t mode); int (*path_chmod) (struct path *path, umode_t mode); int (*path_chown) (struct path *path, uid_t uid, gid_t gid); int (*path_chroot) (struct path *path); #endif Loading Loading @@ -2866,8 +2865,7 @@ int security_path_link(struct dentry *old_dentry, struct path *new_dir, struct dentry *new_dentry); int security_path_rename(struct path *old_dir, struct dentry *old_dentry, struct path *new_dir, struct dentry *new_dentry); int security_path_chmod(struct dentry *dentry, struct vfsmount *mnt, umode_t mode); int security_path_chmod(struct path *path, umode_t mode); int security_path_chown(struct path *path, uid_t uid, gid_t gid); int security_path_chroot(struct path *path); #else /* CONFIG_SECURITY_PATH */ Loading Loading @@ -2919,9 +2917,7 @@ static inline int security_path_rename(struct path *old_dir, return 0; } static inline int security_path_chmod(struct dentry *dentry, struct vfsmount *mnt, umode_t mode) static inline int security_path_chmod(struct path *path, umode_t mode) { return 0; } Loading security/apparmor/lsm.c +3 −4 Original line number Diff line number Diff line Loading @@ -344,13 +344,12 @@ static int apparmor_path_rename(struct path *old_dir, struct dentry *old_dentry, return error; } static int apparmor_path_chmod(struct dentry *dentry, struct vfsmount *mnt, umode_t mode) static int apparmor_path_chmod(struct path *path, umode_t mode) { if (!mediated_filesystem(dentry->d_inode)) if (!mediated_filesystem(path->dentry->d_inode)) return 0; return common_perm_mnt_dentry(OP_CHMOD, mnt, dentry, AA_MAY_CHMOD); return common_perm_mnt_dentry(OP_CHMOD, path->mnt, path->dentry, AA_MAY_CHMOD); } static int apparmor_path_chown(struct path *path, uid_t uid, gid_t gid) Loading security/capability.c +1 −2 Original line number Diff line number Diff line Loading @@ -279,8 +279,7 @@ static int cap_path_truncate(struct path *path) return 0; } static int cap_path_chmod(struct dentry *dentry, struct vfsmount *mnt, umode_t mode) static int cap_path_chmod(struct path *path, umode_t mode) { return 0; } Loading security/security.c +3 −4 Original line number Diff line number Diff line Loading @@ -454,12 +454,11 @@ int security_path_truncate(struct path *path) return security_ops->path_truncate(path); } int security_path_chmod(struct dentry *dentry, struct vfsmount *mnt, umode_t mode) int security_path_chmod(struct path *path, umode_t mode) { if (unlikely(IS_PRIVATE(dentry->d_inode))) if (unlikely(IS_PRIVATE(path->dentry->d_inode))) return 0; return security_ops->path_chmod(dentry, mnt, mode); return security_ops->path_chmod(path, mode); } int security_path_chown(struct path *path, uid_t uid, gid_t gid) Loading Loading
fs/open.c +1 −1 Original line number Diff line number Diff line Loading @@ -456,7 +456,7 @@ static int chmod_common(struct path *path, umode_t mode) if (error) return error; mutex_lock(&inode->i_mutex); error = security_path_chmod(path->dentry, path->mnt, mode); error = security_path_chmod(path, mode); if (error) goto out_unlock; newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO); Loading
include/linux/security.h +3 −7 Original line number Diff line number Diff line Loading @@ -1435,8 +1435,7 @@ struct security_operations { struct dentry *new_dentry); int (*path_rename) (struct path *old_dir, struct dentry *old_dentry, struct path *new_dir, struct dentry *new_dentry); int (*path_chmod) (struct dentry *dentry, struct vfsmount *mnt, umode_t mode); int (*path_chmod) (struct path *path, umode_t mode); int (*path_chown) (struct path *path, uid_t uid, gid_t gid); int (*path_chroot) (struct path *path); #endif Loading Loading @@ -2866,8 +2865,7 @@ int security_path_link(struct dentry *old_dentry, struct path *new_dir, struct dentry *new_dentry); int security_path_rename(struct path *old_dir, struct dentry *old_dentry, struct path *new_dir, struct dentry *new_dentry); int security_path_chmod(struct dentry *dentry, struct vfsmount *mnt, umode_t mode); int security_path_chmod(struct path *path, umode_t mode); int security_path_chown(struct path *path, uid_t uid, gid_t gid); int security_path_chroot(struct path *path); #else /* CONFIG_SECURITY_PATH */ Loading Loading @@ -2919,9 +2917,7 @@ static inline int security_path_rename(struct path *old_dir, return 0; } static inline int security_path_chmod(struct dentry *dentry, struct vfsmount *mnt, umode_t mode) static inline int security_path_chmod(struct path *path, umode_t mode) { return 0; } Loading
security/apparmor/lsm.c +3 −4 Original line number Diff line number Diff line Loading @@ -344,13 +344,12 @@ static int apparmor_path_rename(struct path *old_dir, struct dentry *old_dentry, return error; } static int apparmor_path_chmod(struct dentry *dentry, struct vfsmount *mnt, umode_t mode) static int apparmor_path_chmod(struct path *path, umode_t mode) { if (!mediated_filesystem(dentry->d_inode)) if (!mediated_filesystem(path->dentry->d_inode)) return 0; return common_perm_mnt_dentry(OP_CHMOD, mnt, dentry, AA_MAY_CHMOD); return common_perm_mnt_dentry(OP_CHMOD, path->mnt, path->dentry, AA_MAY_CHMOD); } static int apparmor_path_chown(struct path *path, uid_t uid, gid_t gid) Loading
security/capability.c +1 −2 Original line number Diff line number Diff line Loading @@ -279,8 +279,7 @@ static int cap_path_truncate(struct path *path) return 0; } static int cap_path_chmod(struct dentry *dentry, struct vfsmount *mnt, umode_t mode) static int cap_path_chmod(struct path *path, umode_t mode) { return 0; } Loading
security/security.c +3 −4 Original line number Diff line number Diff line Loading @@ -454,12 +454,11 @@ int security_path_truncate(struct path *path) return security_ops->path_truncate(path); } int security_path_chmod(struct dentry *dentry, struct vfsmount *mnt, umode_t mode) int security_path_chmod(struct path *path, umode_t mode) { if (unlikely(IS_PRIVATE(dentry->d_inode))) if (unlikely(IS_PRIVATE(path->dentry->d_inode))) return 0; return security_ops->path_chmod(dentry, mnt, mode); return security_ops->path_chmod(path, mode); } int security_path_chown(struct path *path, uid_t uid, gid_t gid) Loading