Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

switch security_path_chmod() to struct path *

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro cdcf116d d8c9584e

+15 -25
+1 -1
fs/open.c
··· 456 456 if (error) 457 457 return error; 458 458 mutex_lock(&inode->i_mutex); 459 - error = security_path_chmod(path->dentry, path->mnt, mode); 459 + error = security_path_chmod(path, mode); 460 460 if (error) 461 461 goto out_unlock; 462 462 newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO);
+3 -7
include/linux/security.h
··· 1435 1435 struct dentry *new_dentry); 1436 1436 int (*path_rename) (struct path *old_dir, struct dentry *old_dentry, 1437 1437 struct path *new_dir, struct dentry *new_dentry); 1438 - int (*path_chmod) (struct dentry *dentry, struct vfsmount *mnt, 1439 - umode_t mode); 1438 + int (*path_chmod) (struct path *path, umode_t mode); 1440 1439 int (*path_chown) (struct path *path, uid_t uid, gid_t gid); 1441 1440 int (*path_chroot) (struct path *path); 1442 1441 #endif ··· 2865 2866 struct dentry *new_dentry); 2866 2867 int security_path_rename(struct path *old_dir, struct dentry *old_dentry, 2867 2868 struct path *new_dir, struct dentry *new_dentry); 2868 - int security_path_chmod(struct dentry *dentry, struct vfsmount *mnt, 2869 - umode_t mode); 2869 + int security_path_chmod(struct path *path, umode_t mode); 2870 2870 int security_path_chown(struct path *path, uid_t uid, gid_t gid); 2871 2871 int security_path_chroot(struct path *path); 2872 2872 #else /* CONFIG_SECURITY_PATH */ ··· 2917 2919 return 0; 2918 2920 } 2919 2921 2920 - static inline int security_path_chmod(struct dentry *dentry, 2921 - struct vfsmount *mnt, 2922 - umode_t mode) 2922 + static inline int security_path_chmod(struct path *path, umode_t mode) 2923 2923 { 2924 2924 return 0; 2925 2925 }
+3 -4
security/apparmor/lsm.c
··· 344 344 return error; 345 345 } 346 346 347 - static int apparmor_path_chmod(struct dentry *dentry, struct vfsmount *mnt, 348 - umode_t mode) 347 + static int apparmor_path_chmod(struct path *path, umode_t mode) 349 348 { 350 - if (!mediated_filesystem(dentry->d_inode)) 349 + if (!mediated_filesystem(path->dentry->d_inode)) 351 350 return 0; 352 351 353 - return common_perm_mnt_dentry(OP_CHMOD, mnt, dentry, AA_MAY_CHMOD); 352 + return common_perm_mnt_dentry(OP_CHMOD, path->mnt, path->dentry, AA_MAY_CHMOD); 354 353 } 355 354 356 355 static int apparmor_path_chown(struct path *path, uid_t uid, gid_t gid)
+1 -2
security/capability.c
··· 279 279 return 0; 280 280 } 281 281 282 - static int cap_path_chmod(struct dentry *dentry, struct vfsmount *mnt, 283 - umode_t mode) 282 + static int cap_path_chmod(struct path *path, umode_t mode) 284 283 { 285 284 return 0; 286 285 }
+3 -4
security/security.c
··· 454 454 return security_ops->path_truncate(path); 455 455 } 456 456 457 - int security_path_chmod(struct dentry *dentry, struct vfsmount *mnt, 458 - umode_t mode) 457 + int security_path_chmod(struct path *path, umode_t mode) 459 458 { 460 - if (unlikely(IS_PRIVATE(dentry->d_inode))) 459 + if (unlikely(IS_PRIVATE(path->dentry->d_inode))) 461 460 return 0; 462 - return security_ops->path_chmod(dentry, mnt, mode); 461 + return security_ops->path_chmod(path, mode); 463 462 } 464 463 465 464 int security_path_chown(struct path *path, uid_t uid, gid_t gid)
+4 -7
security/tomoyo/tomoyo.c
··· 353 353 /** 354 354 * tomoyo_path_chmod - Target for security_path_chmod(). 355 355 * 356 - * @dentry: Pointer to "struct dentry". 357 - * @mnt: Pointer to "struct vfsmount". 358 - * @mode: DAC permission mode. 356 + * @path: Pointer to "struct path". 357 + * @mode: DAC permission mode. 359 358 * 360 359 * Returns 0 on success, negative value otherwise. 361 360 */ 362 - static int tomoyo_path_chmod(struct dentry *dentry, struct vfsmount *mnt, 363 - umode_t mode) 361 + static int tomoyo_path_chmod(struct path *path, umode_t mode) 364 362 { 365 - struct path path = { mnt, dentry }; 366 - return tomoyo_path_number_perm(TOMOYO_TYPE_CHMOD, &path, 363 + return tomoyo_path_number_perm(TOMOYO_TYPE_CHMOD, path, 367 364 mode & S_IALLUGO); 368 365 } 369 366