[CRIU] [PATCH] unix: Don't dump external peer w/o name

Pavel Emelyanov xemul at parallels.com
Fri Jun 5 05:53:20 PDT 2015


On restore we will use the peer's name to connect() the
socket back, so if there's no name dump should be aborted.

This situation happens when we create a socketpair(), fork
and dump only one task with one pair end.

Artem Kuzmitskiy <artem.kuzmitskiy at gmail.com>
Signed-off-by: Pavel Emelyanov <xemul at parallels.com>
---
 sk-unix.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/sk-unix.c b/sk-unix.c
index 205df7c..2a4df85 100644
--- a/sk-unix.c
+++ b/sk-unix.c
@@ -564,6 +564,12 @@ static int dump_external_sockets(struct unix_sk_desc *peer)
 				pr_err("Can't dump half of stream unix connection.\n");
 				return -1;
 			}
+
+			if (!peer->name) {
+				show_one_unix("Ext dgram w/o name", peer);
+				pr_err("Can't dump name-less external socket.\n");
+				return -1;
+			}
 		} else if (ret < 0)
 			return -1;
 		else
-- 
1.9.3



More information about the CRIU mailing list