From 467ea87e0cc852a7696d8bdc713f94456dd51df3 Mon Sep 17 00:00:00 2001 From: Pavel Tikhomirov Date: Wed, 14 Dec 2022 14:23:55 +0300 Subject: [PATCH] sk-unix: allocate FdinfoEntry with shmalloc in get_fle_for_task We already do so in other branch of if in dup_fdinfo, let's then do it symmetrically. We later put pointer to this FdinfoEntry in collect_fd_to int alloc_fle to fdinfo_list_entry->fe so it can be later used from other places and if one thread modifies it we would not see modification in other threads. Do we really need to see these modifications? - It's Mistery, but better be on the safe side. Signed-off-by: Pavel Tikhomirov (cherry picked from commit 376773c840e1b527f894e83048f0be61869c409a) Signed-off-by: Alexander Mikhalitsyn --- criu/sk-unix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/criu/sk-unix.c b/criu/sk-unix.c index aa987ac30..f41f6c1ef 100644 --- a/criu/sk-unix.c +++ b/criu/sk-unix.c @@ -1095,7 +1095,7 @@ static struct fdinfo_list_entry *get_fle_for_task(struct file_desc *tgt, struct * we need to ... invent a new one! */ - e = xmalloc(sizeof(*e)); + e = shmalloc(sizeof(*e)); if (!e) return NULL;