Commit feae91fe authored by Andrey Vagin's avatar Andrey Vagin Committed by Cyrill Gorcunov

files: restrict number of fdinfo_list_entries

We allocate only one page for fdinfo_list_entries.
In the future we will be able to resize this memory.
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
parent c1e69464
......@@ -111,6 +111,11 @@ static int collect_fd(int pid, struct fdinfo_entry *e)
pr_info("Collect fdinfo pid=%d fd=%d id=%s\n", pid, e->addr, e->id);
nr_fdinfo_list++;
if ((nr_fdinfo_descs) * sizeof(struct fdinfo_list_entry) >= 4096) {
pr_panic("OOM storing fdinfo_list_entries\n");
return -1;
}
le->pid = pid;
le->fd = e->addr;
le->real_pid = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment