projects
/
platform
/
kernel
/
linux-starfive.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
nfs: verify open flags before allowing open
[platform/kernel/linux-starfive.git]
/
fs
/
nfs
/
nfs4file.c
diff --git
a/fs/nfs/nfs4file.c
b/fs/nfs/nfs4file.c
index
f58c17b
..
dcd39d4
100644
(file)
--- a/
fs/nfs/nfs4file.c
+++ b/
fs/nfs/nfs4file.c
@@
-41,6
+41,10
@@
nfs4_file_open(struct inode *inode, struct file *filp)
dprintk("NFS: open file(%pd2)\n", dentry);
+ err = nfs_check_flags(openflags);
+ if (err)
+ return err;
+
if ((openflags & O_ACCMODE) == 3)
openflags--;