summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2018-06-08 13:40:10 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2018-07-12 10:04:19 -0400
commit6035a27b25ab9dadc8c3d5c5df5eae3fca62fc95 (patch)
tree46b9eb3f1e96efa127e756484a72e508575874b8 /fs
parent73a09dd94377e4b186b300bd5461920710c7c3d5 (diff)
IMA: don't propagate opened through the entire thing
just check ->f_mode in ima_appraise_measurement() Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/namei.c3
-rw-r--r--fs/nfsd/vfs.c2
2 files changed, 2 insertions, 3 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 4bd7cc0d7522..d2aeb282ed05 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -3400,8 +3400,7 @@ finish_open_created:
if (error)
goto out;
opened:
- error = ima_file_check(file, op->acc_mode,
- file->f_mode & FMODE_CREATED ? FILE_CREATED : 0);
+ error = ima_file_check(file, op->acc_mode);
if (!error && will_truncate)
error = handle_truncate(file);
out:
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index b0555d7d8200..55a099e47ba2 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -763,7 +763,7 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, umode_t type,
goto out_nfserr;
}
- host_err = ima_file_check(file, may_flags, 0);
+ host_err = ima_file_check(file, may_flags);
if (host_err) {
fput(file);
goto out_nfserr;