summaryrefslogtreecommitdiffstats
path: root/fs/eventpoll.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2020-09-26 01:48:56 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2020-10-26 01:01:53 +0100
commit0c320f776ed83e1ebde4d49bc316b23e868b4737 (patch)
tree088e549a0b2b62211fc13c20fc00e42ae0e8f99a /fs/eventpoll.c
parentreverse_path_check_proc(): sane arguments (diff)
downloadlinux-0c320f776ed83e1ebde4d49bc316b23e868b4737.tar.xz
linux-0c320f776ed83e1ebde4d49bc316b23e868b4737.zip
reverse_path_check_proc(): don't bother with cookies
We know there's no loops by the time we call it; the only thing we care about is too deep reverse paths. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/eventpoll.c')
-rw-r--r--fs/eventpoll.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index 3e6f1f97f246..0f540e91aa92 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -1311,7 +1311,7 @@ static int reverse_path_check_proc(struct file *file, int depth)
int error = 0;
struct epitem *epi;
- if (!ep_push_nested(file)) /* limits recursion */
+ if (depth > EP_MAX_NESTS) /* too deep nesting */
return -1;
/* CTL_DEL can remove links here, but that can't increase our count */
@@ -1336,7 +1336,6 @@ static int reverse_path_check_proc(struct file *file, int depth)
}
}
rcu_read_unlock();
- nesting--; /* pop */
return error;
}