Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 146440
b: refs/heads/master
c: 14dba53
h: refs/heads/master
v: v3
  • Loading branch information
Mimi Zohar authored and James Morris committed May 27, 2009
1 parent 5931549 commit f000037
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 76b0187525f024cb391c8043adf2e359b2adb988
refs/heads/master: 14dba5331b90c20588ae6504fea8049c7283028d
14 changes: 14 additions & 0 deletions trunk/fs/nfsd/vfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#include <linux/security.h>
#endif /* CONFIG_NFSD_V4 */
#include <linux/jhash.h>
#include <linux/ima.h>

#include <asm/uaccess.h>

Expand Down Expand Up @@ -735,6 +736,8 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, int type,
flags, cred);
if (IS_ERR(*filp))
host_err = PTR_ERR(*filp);
else
ima_counts_get(*filp);
out_nfserr:
err = nfserrno(host_err);
out:
Expand Down Expand Up @@ -2024,6 +2027,7 @@ nfsd_permission(struct svc_rqst *rqstp, struct svc_export *exp,
struct dentry *dentry, int acc)
{
struct inode *inode = dentry->d_inode;
struct path path;
int err;

if (acc == NFSD_MAY_NOP)
Expand Down Expand Up @@ -2096,7 +2100,17 @@ nfsd_permission(struct svc_rqst *rqstp, struct svc_export *exp,
if (err == -EACCES && S_ISREG(inode->i_mode) &&
acc == (NFSD_MAY_READ | NFSD_MAY_OWNER_OVERRIDE))
err = inode_permission(inode, MAY_EXEC);
if (err)
goto nfsd_out;

/* Do integrity (permission) checking now, but defer incrementing
* IMA counts to the actual file open.
*/
path.mnt = exp->ex_path.mnt;
path.dentry = dentry;
err = ima_path_check(&path, acc & (MAY_READ | MAY_WRITE | MAY_EXEC),
IMA_COUNT_LEAVE);
nfsd_out:
return err? nfserrno(err) : 0;
}

Expand Down

0 comments on commit f000037

Please sign in to comment.