projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.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
|
blame
|
history
diff --git
a/fs/namei.c
b/fs/namei.c
index 3951cc4f34c556160d414c899fd6fafd72f22d07..8d562a7a7e019ae107195311d11756990ef93d5b 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;