atomic_open(): be paranoid about may_open() return value
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>
diff --git a/fs/namei.c b/fs/namei.c
index 3951cc4..8d562a7 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2920,6 +2920,8 @@
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;