diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-14 18:31:03 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-14 18:31:03 -0400 |
| commit | ca2ec32658db160745990496f0f4580056a5dc9f (patch) | |
| tree | d211f239219c85214da46dc1cbad4184a81d0248 /security | |
| parent | 6c8a53c9e6a151fffb07f8b4c34bd1e33dddd467 (diff) | |
| parent | fdc81f45e9f57858da6351836507fbcf1b7583ee (diff) | |
Merge branch 'for-linus-1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs update from Al Viro:
"Part one:
- struct filename-related cleanups
- saner iov_iter_init() replacements (and switching the syscalls to
use of those)
- ntfs switch to ->write_iter() (Anton)
- aio cleanups and splitting iocb into common and async parts
(Christoph)
- assorted fixes (me, bfields, Andrew Elble)
There's a lot more, including the completion of switchover to
->{read,write}_iter(), d_inode/d_backing_inode annotations, f_flags
race fixes, etc, but that goes after #for-davem merge. David has
pulled it, and once it's in I'll send the next vfs pull request"
* 'for-linus-1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (35 commits)
sg_start_req(): use import_iovec()
sg_start_req(): make sure that there's not too many elements in iovec
blk_rq_map_user(): use import_single_range()
sg_io(): use import_iovec()
process_vm_access: switch to {compat_,}import_iovec()
switch keyctl_instantiate_key_common() to iov_iter
switch {compat_,}do_readv_writev() to {compat_,}import_iovec()
aio_setup_vectored_rw(): switch to {compat_,}import_iovec()
vmsplice_to_user(): switch to import_iovec()
kill aio_setup_single_vector()
aio: simplify arguments of aio_setup_..._rw()
aio: lift iov_iter_init() into aio_setup_..._rw()
lift iov_iter into {compat_,}do_readv_writev()
NFS: fix BUG() crash in notify_change() with patch to chown_common()
dcache: return -ESTALE not -EBUSY on distributed fs race
NTFS: Version 2.1.32 - Update file write from aio_write to write_iter.
VFS: Add iov_iter_fault_in_multipages_readable()
drop bogus check in file_open_root()
switch security_inode_getattr() to struct path *
constify tomoyo_realpath_from_path()
...
Diffstat (limited to 'security')
| -rw-r--r-- | security/apparmor/lsm.c | 6 | ||||
| -rw-r--r-- | security/capability.c | 2 | ||||
| -rw-r--r-- | security/keys/compat.c | 29 | ||||
| -rw-r--r-- | security/keys/internal.h | 5 | ||||
| -rw-r--r-- | security/keys/keyctl.c | 78 | ||||
| -rw-r--r-- | security/security.c | 6 | ||||
| -rw-r--r-- | security/selinux/hooks.c | 12 | ||||
| -rw-r--r-- | security/smack/smack_lsm.c | 13 | ||||
| -rw-r--r-- | security/tomoyo/common.h | 4 | ||||
| -rw-r--r-- | security/tomoyo/file.c | 4 | ||||
| -rw-r--r-- | security/tomoyo/realpath.c | 6 | ||||
| -rw-r--r-- | security/tomoyo/tomoyo.c | 5 |
12 files changed, 64 insertions, 106 deletions
diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c index 107db88b1d5f..dd56bffd6500 100644 --- a/security/apparmor/lsm.c +++ b/security/apparmor/lsm.c | |||
| @@ -364,12 +364,12 @@ static int apparmor_path_chown(struct path *path, kuid_t uid, kgid_t gid) | |||
| 364 | return common_perm(OP_CHOWN, path, AA_MAY_CHOWN, &cond); | 364 | return common_perm(OP_CHOWN, path, AA_MAY_CHOWN, &cond); |
| 365 | } | 365 | } |
| 366 | 366 | ||
| 367 | static int apparmor_inode_getattr(struct vfsmount *mnt, struct dentry *dentry) | 367 | static int apparmor_inode_getattr(const struct path *path) |
| 368 | { | 368 | { |
| 369 | if (!mediated_filesystem(dentry)) | 369 | if (!mediated_filesystem(path->dentry)) |
| 370 | return 0; | 370 | return 0; |
| 371 | 371 | ||
| 372 | return common_perm_mnt_dentry(OP_GETATTR, mnt, dentry, | 372 | return common_perm_mnt_dentry(OP_GETATTR, path->mnt, path->dentry, |
| 373 | AA_MAY_META_READ); | 373 | AA_MAY_META_READ); |
| 374 | } | 374 | } |
| 375 | 375 | ||
diff --git a/security/capability.c b/security/capability.c index 070dd46f62f4..bdf22034a961 100644 --- a/security/capability.c +++ b/security/capability.c | |||
| @@ -225,7 +225,7 @@ static int cap_inode_setattr(struct dentry *dentry, struct iattr *iattr) | |||
| 225 | return 0; | 225 | return 0; |
| 226 | } | 226 | } |
| 227 | 227 | ||
| 228 | static int cap_inode_getattr(struct vfsmount *mnt, struct dentry *dentry) | 228 | static int cap_inode_getattr(const struct path *path) |
| 229 | { | 229 | { |
| 230 | return 0; | 230 | return 0; |
| 231 | } | 231 | } |
diff --git a/security/keys/compat.c b/security/keys/compat.c index 347896548ad3..25430a3aa7f7 100644 --- a/security/keys/compat.c +++ b/security/keys/compat.c | |||
| @@ -31,30 +31,21 @@ static long compat_keyctl_instantiate_key_iov( | |||
| 31 | key_serial_t ringid) | 31 | key_serial_t ringid) |
| 32 | { | 32 | { |
| 33 | struct iovec iovstack[UIO_FASTIOV], *iov = iovstack; | 33 | struct iovec iovstack[UIO_FASTIOV], *iov = iovstack; |
| 34 | struct iov_iter from; | ||
| 34 | long ret; | 35 | long ret; |
| 35 | 36 | ||
| 36 | if (!_payload_iov || !ioc) | 37 | if (!_payload_iov) |
| 37 | goto no_payload; | 38 | ioc = 0; |
| 38 | 39 | ||
| 39 | ret = compat_rw_copy_check_uvector(WRITE, _payload_iov, ioc, | 40 | ret = compat_import_iovec(WRITE, _payload_iov, ioc, |
| 40 | ARRAY_SIZE(iovstack), | 41 | ARRAY_SIZE(iovstack), &iov, |
| 41 | iovstack, &iov); | 42 | &from); |
| 42 | if (ret < 0) | 43 | if (ret < 0) |
| 43 | goto err; | 44 | return ret; |
| 44 | if (ret == 0) | ||
| 45 | goto no_payload_free; | ||
| 46 | |||
| 47 | ret = keyctl_instantiate_key_common(id, iov, ioc, ret, ringid); | ||
| 48 | err: | ||
| 49 | if (iov != iovstack) | ||
| 50 | kfree(iov); | ||
| 51 | return ret; | ||
| 52 | 45 | ||
| 53 | no_payload_free: | 46 | ret = keyctl_instantiate_key_common(id, &from, ringid); |
| 54 | if (iov != iovstack) | 47 | kfree(iov); |
| 55 | kfree(iov); | 48 | return ret; |
| 56 | no_payload: | ||
| 57 | return keyctl_instantiate_key_common(id, NULL, 0, 0, ringid); | ||
| 58 | } | 49 | } |
| 59 | 50 | ||
| 60 | /* | 51 | /* |
diff --git a/security/keys/internal.h b/security/keys/internal.h index 200e37867336..5105c2c2da75 100644 --- a/security/keys/internal.h +++ b/security/keys/internal.h | |||
| @@ -243,9 +243,10 @@ extern long keyctl_instantiate_key_iov(key_serial_t, | |||
| 243 | unsigned, key_serial_t); | 243 | unsigned, key_serial_t); |
| 244 | extern long keyctl_invalidate_key(key_serial_t); | 244 | extern long keyctl_invalidate_key(key_serial_t); |
| 245 | 245 | ||
| 246 | struct iov_iter; | ||
| 246 | extern long keyctl_instantiate_key_common(key_serial_t, | 247 | extern long keyctl_instantiate_key_common(key_serial_t, |
| 247 | const struct iovec *, | 248 | struct iov_iter *, |
| 248 | unsigned, size_t, key_serial_t); | 249 | key_serial_t); |
| 249 | #ifdef CONFIG_PERSISTENT_KEYRINGS | 250 | #ifdef CONFIG_PERSISTENT_KEYRINGS |
| 250 | extern long keyctl_get_persistent(uid_t, key_serial_t); | 251 | extern long keyctl_get_persistent(uid_t, key_serial_t); |
| 251 | extern unsigned persistent_keyring_expiry; | 252 | extern unsigned persistent_keyring_expiry; |
diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c index 4743d71e4aa6..0b9ec78a7a7a 100644 --- a/security/keys/keyctl.c +++ b/security/keys/keyctl.c | |||
| @@ -998,21 +998,6 @@ static int keyctl_change_reqkey_auth(struct key *key) | |||
| 998 | } | 998 | } |
| 999 | 999 | ||
| 1000 | /* | 1000 | /* |
| 1001 | * Copy the iovec data from userspace | ||
| 1002 | */ | ||
| 1003 | static long copy_from_user_iovec(void *buffer, const struct iovec *iov, | ||
| 1004 | unsigned ioc) | ||
| 1005 | { | ||
| 1006 | for (; ioc > 0; ioc--) { | ||
| 1007 | if (copy_from_user(buffer, iov->iov_base, iov->iov_len) != 0) | ||
| 1008 | return -EFAULT; | ||
| 1009 | buffer += iov->iov_len; | ||
| 1010 | iov++; | ||
| 1011 | } | ||
| 1012 | return 0; | ||
| 1013 | } | ||
| 1014 | |||
| 1015 | /* | ||
| 1016 | * Instantiate a key with the specified payload and link the key into the | 1001 | * Instantiate a key with the specified payload and link the key into the |
| 1017 | * destination keyring if one is given. | 1002 | * destination keyring if one is given. |
| 1018 | * | 1003 | * |
| @@ -1022,20 +1007,21 @@ static long copy_from_user_iovec(void *buffer, const struct iovec *iov, | |||
| 1022 | * If successful, 0 will be returned. | 1007 | * If successful, 0 will be returned. |
| 1023 | */ | 1008 | */ |
| 1024 | long keyctl_instantiate_key_common(key_serial_t id, | 1009 | long keyctl_instantiate_key_common(key_serial_t id, |
| 1025 | const struct iovec *payload_iov, | 1010 | struct iov_iter *from, |
| 1026 | unsigned ioc, | ||
| 1027 | size_t plen, | ||
| 1028 | key_serial_t ringid) | 1011 | key_serial_t ringid) |
| 1029 | { | 1012 | { |
| 1030 | const struct cred *cred = current_cred(); | 1013 | const struct cred *cred = current_cred(); |
| 1031 | struct request_key_auth *rka; | 1014 | struct request_key_auth *rka; |
| 1032 | struct key *instkey, *dest_keyring; | 1015 | struct key *instkey, *dest_keyring; |
| 1016 | size_t plen = from ? iov_iter_count(from) : 0; | ||
| 1033 | void *payload; | 1017 | void *payload; |
| 1034 | long ret; | 1018 | long ret; |
| 1035 | bool vm = false; | ||
| 1036 | 1019 | ||
| 1037 | kenter("%d,,%zu,%d", id, plen, ringid); | 1020 | kenter("%d,,%zu,%d", id, plen, ringid); |
| 1038 | 1021 | ||
| 1022 | if (!plen) | ||
| 1023 | from = NULL; | ||
| 1024 | |||
| 1039 | ret = -EINVAL; | 1025 | ret = -EINVAL; |
| 1040 | if (plen > 1024 * 1024 - 1) | 1026 | if (plen > 1024 * 1024 - 1) |
| 1041 | goto error; | 1027 | goto error; |
| @@ -1054,20 +1040,19 @@ long keyctl_instantiate_key_common(key_serial_t id, | |||
| 1054 | /* pull the payload in if one was supplied */ | 1040 | /* pull the payload in if one was supplied */ |
| 1055 | payload = NULL; | 1041 | payload = NULL; |
| 1056 | 1042 | ||
| 1057 | if (payload_iov) { | 1043 | if (from) { |
| 1058 | ret = -ENOMEM; | 1044 | ret = -ENOMEM; |
| 1059 | payload = kmalloc(plen, GFP_KERNEL); | 1045 | payload = kmalloc(plen, GFP_KERNEL); |
| 1060 | if (!payload) { | 1046 | if (!payload) { |
| 1061 | if (plen <= PAGE_SIZE) | 1047 | if (plen <= PAGE_SIZE) |
| 1062 | goto error; | 1048 | goto error; |
| 1063 | vm = true; | ||
| 1064 | payload = vmalloc(plen); | 1049 | payload = vmalloc(plen); |
| 1065 | if (!payload) | 1050 | if (!payload) |
| 1066 | goto error; | 1051 | goto error; |
| 1067 | } | 1052 | } |
| 1068 | 1053 | ||
| 1069 | ret = copy_from_user_iovec(payload, payload_iov, ioc); | 1054 | ret = -EFAULT; |
| 1070 | if (ret < 0) | 1055 | if (copy_from_iter(payload, plen, from) != plen) |
| 1071 | goto error2; | 1056 | goto error2; |
| 1072 | } | 1057 | } |
| 1073 | 1058 | ||
| @@ -1089,10 +1074,7 @@ long keyctl_instantiate_key_common(key_serial_t id, | |||
| 1089 | keyctl_change_reqkey_auth(NULL); | 1074 | keyctl_change_reqkey_auth(NULL); |
| 1090 | 1075 | ||
| 1091 | error2: | 1076 | error2: |
| 1092 | if (!vm) | 1077 | kvfree(payload); |
| 1093 | kfree(payload); | ||
| 1094 | else | ||
| 1095 | vfree(payload); | ||
| 1096 | error: | 1078 | error: |
| 1097 | return ret; | 1079 | return ret; |
| 1098 | } | 1080 | } |
| @@ -1112,15 +1094,19 @@ long keyctl_instantiate_key(key_serial_t id, | |||
| 1112 | key_serial_t ringid) | 1094 | key_serial_t ringid) |
| 1113 | { | 1095 | { |
| 1114 | if (_payload && plen) { | 1096 | if (_payload && plen) { |
| 1115 | struct iovec iov[1] = { | 1097 | struct iovec iov; |
| 1116 | [0].iov_base = (void __user *)_payload, | 1098 | struct iov_iter from; |
| 1117 | [0].iov_len = plen | 1099 | int ret; |
| 1118 | }; | ||
| 1119 | 1100 | ||
| 1120 | return keyctl_instantiate_key_common(id, iov, 1, plen, ringid); | 1101 | ret = import_single_range(WRITE, (void __user *)_payload, plen, |
| 1102 | &iov, &from); | ||
| 1103 | if (unlikely(ret)) | ||
| 1104 | return ret; | ||
| 1105 | |||
| 1106 | return keyctl_instantiate_key_common(id, &from, ringid); | ||
| 1121 | } | 1107 | } |
| 1122 | 1108 | ||
| 1123 | return keyctl_instantiate_key_common(id, NULL, 0, 0, ringid); | 1109 | return keyctl_instantiate_key_common(id, NULL, ringid); |
| 1124 | } | 1110 | } |
| 1125 | 1111 | ||
| 1126 | /* | 1112 | /* |
| @@ -1138,29 +1124,19 @@ long keyctl_instantiate_key_iov(key_serial_t id, | |||
| 1138 | key_serial_t ringid) | 1124 | key_serial_t ringid) |
| 1139 | { | 1125 | { |
| 1140 | struct iovec iovstack[UIO_FASTIOV], *iov = iovstack; | 1126 | struct iovec iovstack[UIO_FASTIOV], *iov = iovstack; |
| 1127 | struct iov_iter from; | ||
| 1141 | long ret; | 1128 | long ret; |
| 1142 | 1129 | ||
| 1143 | if (!_payload_iov || !ioc) | 1130 | if (!_payload_iov) |
| 1144 | goto no_payload; | 1131 | ioc = 0; |
| 1145 | 1132 | ||
| 1146 | ret = rw_copy_check_uvector(WRITE, _payload_iov, ioc, | 1133 | ret = import_iovec(WRITE, _payload_iov, ioc, |
| 1147 | ARRAY_SIZE(iovstack), iovstack, &iov); | 1134 | ARRAY_SIZE(iovstack), &iov, &from); |
| 1148 | if (ret < 0) | 1135 | if (ret < 0) |
| 1149 | goto err; | 1136 | return ret; |
| 1150 | if (ret == 0) | 1137 | ret = keyctl_instantiate_key_common(id, &from, ringid); |
| 1151 | goto no_payload_free; | 1138 | kfree(iov); |
| 1152 | |||
| 1153 | ret = keyctl_instantiate_key_common(id, iov, ioc, ret, ringid); | ||
| 1154 | err: | ||
| 1155 | if (iov != iovstack) | ||
| 1156 | kfree(iov); | ||
| 1157 | return ret; | 1139 | return ret; |
| 1158 | |||
| 1159 | no_payload_free: | ||
| 1160 | if (iov != iovstack) | ||
| 1161 | kfree(iov); | ||
| 1162 | no_payload: | ||
| 1163 | return keyctl_instantiate_key_common(id, NULL, 0, 0, ringid); | ||
| 1164 | } | 1140 | } |
| 1165 | 1141 | ||
| 1166 | /* | 1142 | /* |
diff --git a/security/security.c b/security/security.c index e81d5bbe7363..ed890c6d31c5 100644 --- a/security/security.c +++ b/security/security.c | |||
| @@ -608,11 +608,11 @@ int security_inode_setattr(struct dentry *dentry, struct iattr *attr) | |||
| 608 | } | 608 | } |
| 609 | EXPORT_SYMBOL_GPL(security_inode_setattr); | 609 | EXPORT_SYMBOL_GPL(security_inode_setattr); |
| 610 | 610 | ||
| 611 | int security_inode_getattr(struct vfsmount *mnt, struct dentry *dentry) | 611 | int security_inode_getattr(const struct path *path) |
| 612 | { | 612 | { |
| 613 | if (unlikely(IS_PRIVATE(dentry->d_inode))) | 613 | if (unlikely(IS_PRIVATE(path->dentry->d_inode))) |
| 614 | return 0; | 614 | return 0; |
| 615 | return security_ops->inode_getattr(mnt, dentry); | 615 | return security_ops->inode_getattr(path); |
| 616 | } | 616 | } |
| 617 | 617 | ||
| 618 | int security_inode_setxattr(struct dentry *dentry, const char *name, | 618 | int security_inode_setxattr(struct dentry *dentry, const char *name, |
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 4d1a54190388..e119cdcffc87 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
| @@ -1623,7 +1623,7 @@ static inline int dentry_has_perm(const struct cred *cred, | |||
| 1623 | the path to help the auditing code to more easily generate the | 1623 | the path to help the auditing code to more easily generate the |
| 1624 | pathname if needed. */ | 1624 | pathname if needed. */ |
| 1625 | static inline int path_has_perm(const struct cred *cred, | 1625 | static inline int path_has_perm(const struct cred *cred, |
| 1626 | struct path *path, | 1626 | const struct path *path, |
| 1627 | u32 av) | 1627 | u32 av) |
| 1628 | { | 1628 | { |
| 1629 | struct inode *inode = path->dentry->d_inode; | 1629 | struct inode *inode = path->dentry->d_inode; |
| @@ -2954,15 +2954,9 @@ static int selinux_inode_setattr(struct dentry *dentry, struct iattr *iattr) | |||
| 2954 | return dentry_has_perm(cred, dentry, av); | 2954 | return dentry_has_perm(cred, dentry, av); |
| 2955 | } | 2955 | } |
| 2956 | 2956 | ||
| 2957 | static int selinux_inode_getattr(struct vfsmount *mnt, struct dentry *dentry) | 2957 | static int selinux_inode_getattr(const struct path *path) |
| 2958 | { | 2958 | { |
| 2959 | const struct cred *cred = current_cred(); | 2959 | return path_has_perm(current_cred(), path, FILE__GETATTR); |
| 2960 | struct path path; | ||
| 2961 | |||
| 2962 | path.dentry = dentry; | ||
| 2963 | path.mnt = mnt; | ||
| 2964 | |||
| 2965 | return path_has_perm(cred, &path, FILE__GETATTR); | ||
| 2966 | } | 2960 | } |
| 2967 | 2961 | ||
| 2968 | static int selinux_inode_setotherxattr(struct dentry *dentry, const char *name) | 2962 | static int selinux_inode_setotherxattr(struct dentry *dentry, const char *name) |
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index c934311812f1..1511965549b8 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c | |||
| @@ -1034,19 +1034,16 @@ static int smack_inode_setattr(struct dentry *dentry, struct iattr *iattr) | |||
| 1034 | * | 1034 | * |
| 1035 | * Returns 0 if access is permitted, an error code otherwise | 1035 | * Returns 0 if access is permitted, an error code otherwise |
| 1036 | */ | 1036 | */ |
| 1037 | static int smack_inode_getattr(struct vfsmount *mnt, struct dentry *dentry) | 1037 | static int smack_inode_getattr(const struct path *path) |
| 1038 | { | 1038 | { |
| 1039 | struct smk_audit_info ad; | 1039 | struct smk_audit_info ad; |
| 1040 | struct path path; | 1040 | struct inode *inode = path->dentry->d_inode; |
| 1041 | int rc; | 1041 | int rc; |
| 1042 | 1042 | ||
| 1043 | path.dentry = dentry; | ||
| 1044 | path.mnt = mnt; | ||
| 1045 | |||
| 1046 | smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_PATH); | 1043 | smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_PATH); |
| 1047 | smk_ad_setfield_u_fs_path(&ad, path); | 1044 | smk_ad_setfield_u_fs_path(&ad, *path); |
| 1048 | rc = smk_curacc(smk_of_inode(dentry->d_inode), MAY_READ, &ad); | 1045 | rc = smk_curacc(smk_of_inode(inode), MAY_READ, &ad); |
| 1049 | rc = smk_bu_inode(dentry->d_inode, MAY_READ, rc); | 1046 | rc = smk_bu_inode(inode, MAY_READ, rc); |
| 1050 | return rc; | 1047 | return rc; |
| 1051 | } | 1048 | } |
| 1052 | 1049 | ||
diff --git a/security/tomoyo/common.h b/security/tomoyo/common.h index b897d4862016..f9c9fb1d56b4 100644 --- a/security/tomoyo/common.h +++ b/security/tomoyo/common.h | |||
| @@ -945,7 +945,7 @@ char *tomoyo_encode2(const char *str, int str_len); | |||
| 945 | char *tomoyo_init_log(struct tomoyo_request_info *r, int len, const char *fmt, | 945 | char *tomoyo_init_log(struct tomoyo_request_info *r, int len, const char *fmt, |
| 946 | va_list args); | 946 | va_list args); |
| 947 | char *tomoyo_read_token(struct tomoyo_acl_param *param); | 947 | char *tomoyo_read_token(struct tomoyo_acl_param *param); |
| 948 | char *tomoyo_realpath_from_path(struct path *path); | 948 | char *tomoyo_realpath_from_path(const struct path *path); |
| 949 | char *tomoyo_realpath_nofollow(const char *pathname); | 949 | char *tomoyo_realpath_nofollow(const char *pathname); |
| 950 | const char *tomoyo_get_exe(void); | 950 | const char *tomoyo_get_exe(void); |
| 951 | const char *tomoyo_yesno(const unsigned int value); | 951 | const char *tomoyo_yesno(const unsigned int value); |
| @@ -978,7 +978,7 @@ int tomoyo_path2_perm(const u8 operation, struct path *path1, | |||
| 978 | struct path *path2); | 978 | struct path *path2); |
| 979 | int tomoyo_path_number_perm(const u8 operation, struct path *path, | 979 | int tomoyo_path_number_perm(const u8 operation, struct path *path, |
| 980 | unsigned long number); | 980 | unsigned long number); |
| 981 | int tomoyo_path_perm(const u8 operation, struct path *path, | 981 | int tomoyo_path_perm(const u8 operation, const struct path *path, |
| 982 | const char *target); | 982 | const char *target); |
| 983 | unsigned int tomoyo_poll_control(struct file *file, poll_table *wait); | 983 | unsigned int tomoyo_poll_control(struct file *file, poll_table *wait); |
| 984 | unsigned int tomoyo_poll_log(struct file *file, poll_table *wait); | 984 | unsigned int tomoyo_poll_log(struct file *file, poll_table *wait); |
diff --git a/security/tomoyo/file.c b/security/tomoyo/file.c index c151a1869597..2367b100cc62 100644 --- a/security/tomoyo/file.c +++ b/security/tomoyo/file.c | |||
| @@ -145,7 +145,7 @@ static void tomoyo_add_slash(struct tomoyo_path_info *buf) | |||
| 145 | * | 145 | * |
| 146 | * Returns true on success, false otherwise. | 146 | * Returns true on success, false otherwise. |
| 147 | */ | 147 | */ |
| 148 | static bool tomoyo_get_realpath(struct tomoyo_path_info *buf, struct path *path) | 148 | static bool tomoyo_get_realpath(struct tomoyo_path_info *buf, const struct path *path) |
| 149 | { | 149 | { |
| 150 | buf->name = tomoyo_realpath_from_path(path); | 150 | buf->name = tomoyo_realpath_from_path(path); |
| 151 | if (buf->name) { | 151 | if (buf->name) { |
| @@ -782,7 +782,7 @@ int tomoyo_check_open_permission(struct tomoyo_domain_info *domain, | |||
| 782 | * | 782 | * |
| 783 | * Returns 0 on success, negative value otherwise. | 783 | * Returns 0 on success, negative value otherwise. |
| 784 | */ | 784 | */ |
| 785 | int tomoyo_path_perm(const u8 operation, struct path *path, const char *target) | 785 | int tomoyo_path_perm(const u8 operation, const struct path *path, const char *target) |
| 786 | { | 786 | { |
| 787 | struct tomoyo_request_info r; | 787 | struct tomoyo_request_info r; |
| 788 | struct tomoyo_obj_info obj = { | 788 | struct tomoyo_obj_info obj = { |
diff --git a/security/tomoyo/realpath.c b/security/tomoyo/realpath.c index bed745c8b1a3..1e0d480ff6a6 100644 --- a/security/tomoyo/realpath.c +++ b/security/tomoyo/realpath.c | |||
| @@ -89,7 +89,7 @@ char *tomoyo_encode(const char *str) | |||
| 89 | * | 89 | * |
| 90 | * If dentry is a directory, trailing '/' is appended. | 90 | * If dentry is a directory, trailing '/' is appended. |
| 91 | */ | 91 | */ |
| 92 | static char *tomoyo_get_absolute_path(struct path *path, char * const buffer, | 92 | static char *tomoyo_get_absolute_path(const struct path *path, char * const buffer, |
| 93 | const int buflen) | 93 | const int buflen) |
| 94 | { | 94 | { |
| 95 | char *pos = ERR_PTR(-ENOMEM); | 95 | char *pos = ERR_PTR(-ENOMEM); |
| @@ -216,7 +216,7 @@ out: | |||
| 216 | * | 216 | * |
| 217 | * Returns the buffer. | 217 | * Returns the buffer. |
| 218 | */ | 218 | */ |
| 219 | static char *tomoyo_get_socket_name(struct path *path, char * const buffer, | 219 | static char *tomoyo_get_socket_name(const struct path *path, char * const buffer, |
| 220 | const int buflen) | 220 | const int buflen) |
| 221 | { | 221 | { |
| 222 | struct inode *inode = path->dentry->d_inode; | 222 | struct inode *inode = path->dentry->d_inode; |
| @@ -247,7 +247,7 @@ static char *tomoyo_get_socket_name(struct path *path, char * const buffer, | |||
| 247 | * These functions use kzalloc(), so the caller must call kfree() | 247 | * These functions use kzalloc(), so the caller must call kfree() |
| 248 | * if these functions didn't return NULL. | 248 | * if these functions didn't return NULL. |
| 249 | */ | 249 | */ |
| 250 | char *tomoyo_realpath_from_path(struct path *path) | 250 | char *tomoyo_realpath_from_path(const struct path *path) |
| 251 | { | 251 | { |
| 252 | char *buf = NULL; | 252 | char *buf = NULL; |
| 253 | char *name = NULL; | 253 | char *name = NULL; |
diff --git a/security/tomoyo/tomoyo.c b/security/tomoyo/tomoyo.c index f0b756e27fed..57c88d52ffa5 100644 --- a/security/tomoyo/tomoyo.c +++ b/security/tomoyo/tomoyo.c | |||
| @@ -144,10 +144,9 @@ static int tomoyo_bprm_check_security(struct linux_binprm *bprm) | |||
| 144 | * | 144 | * |
| 145 | * Returns 0 on success, negative value otherwise. | 145 | * Returns 0 on success, negative value otherwise. |
| 146 | */ | 146 | */ |
| 147 | static int tomoyo_inode_getattr(struct vfsmount *mnt, struct dentry *dentry) | 147 | static int tomoyo_inode_getattr(const struct path *path) |
| 148 | { | 148 | { |
| 149 | struct path path = { mnt, dentry }; | 149 | return tomoyo_path_perm(TOMOYO_TYPE_GETATTR, path, NULL); |
| 150 | return tomoyo_path_perm(TOMOYO_TYPE_GETATTR, &path, NULL); | ||
| 151 | } | 150 | } |
| 152 | 151 | ||
| 153 | /** | 152 | /** |
