OSDN Git Service
(root)
/
tomoyo
/
tomoyo-test1.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0fb1ea0
)
atomic_open(): be paranoid about may_open() return value
author
Al Viro
<viro@zeniv.linux.org.uk>
Wed, 27 Apr 2016 19:47:45 +0000
(15:47 -0400)
committer
Al Viro
<viro@zeniv.linux.org.uk>
Mon, 2 May 2016 23:51:14 +0000
(19:51 -0400)
It should never return positives; however, with Linux S&M crowd
involved, no bogosity is impossible. Results would be unpleasant...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/namei.c
patch
|
blob
|
history
diff --git
a/fs/namei.c
b/fs/namei.c
index
3951cc4
..
8d562a7
100644
(file)
--- a/
fs/namei.c
+++ b/
fs/namei.c
@@
-2920,6
+2920,8
@@
static int atomic_open(struct nameidata *nd, struct dentry *dentry,
acc_mode = 0;
}
error = may_open(&file->f_path, acc_mode, open_flag);
+ if (WARN_ON(error > 0))
+ error = -EINVAL;
out:
dput(dentry);
return error;