mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
net: don't call netns_entry__free_unpacked for uninitialized pointer (v2)
If the netns image is absent, the NetnsEntry entry will not be initialized. Currently restore from old images crashes: Core was generated by `criu swrk 3'. Program terminated with signal SIGSEGV, Segmentation fault. $0 0x0000000000427d80 in netns_entry.free_unpacked () (gdb) bt $0 0x0000000000427d80 in netns_entry.free_unpacked () $1 0x0000000000436d07 in prepare_net_ns () $2 0x0000000000457c78 in prepare_namespace () $3 0x0000000000432917 in restore_task_with_children () $4 0x00007fc86acfccfd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111 v2: remove debugging code Cc: Pavel Tikhomirov <ptikhomirov@virtuozzo.com> Signed-off-by: Andrey Vagin <avagin@openvz.org> Acked-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
8c5bf2b723
commit
dbe907ddc7
1 changed files with 3 additions and 2 deletions
5
net.c
5
net.c
|
|
@ -728,12 +728,13 @@ int dump_net_ns(int ns_id)
|
|||
int prepare_net_ns(int pid)
|
||||
{
|
||||
int ret;
|
||||
NetnsEntry *netns;
|
||||
NetnsEntry *netns = NULL;
|
||||
|
||||
ret = restore_netns_conf(pid, &netns);
|
||||
if (!ret)
|
||||
ret = restore_links(pid, &netns);
|
||||
netns_entry__free_unpacked(netns, NULL);
|
||||
if (netns)
|
||||
netns_entry__free_unpacked(netns, NULL);
|
||||
|
||||
if (!ret)
|
||||
ret = restore_ifaddr(pid);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue