mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 06:15:24 +00:00
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: Andrey Vagin <avagin@openvz.org> Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
This commit is contained in:
committed by
Cyrill Gorcunov
parent
c1e69464dc
commit
feae91fe9d
5
files.c
5
files.c
@@ -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;
|
||||
|
Reference in New Issue
Block a user