[CRIU] mount namespace in criu

Cyrill Gorcunov gorcunov at openvz.org
Wed Jun 27 15:48:56 EDT 2012


On Wed, Jun 27, 2012 at 09:01:45PM +0400, Pavel Emelyanov wrote:
> Hi guys.
> 
> An first step of the subj is on repo. All zdtms are passing OK. Only virtual proc
> and sysfs filesystems are supported, no bindmounts for now and no fixes for
> paths-vs-namespaceroot in the code. Just plain simple tree recreation.
> 
> Andrey, there's a problem with our test_init in zdtm -- it uses system() call
> to run make stop, but strictly speaking this doesn't work -- this test_init
> stuff doesn't have any fds open (image is empty) and if on restore I explicitly
> close them (we should do it) the system() just fails :(
> 
> Let's discuss this tomorrow.

Huston, it seems we've a mem leaks here.

b5803455181b5f3b289834f6453c00c4bac5024c

@@ -603,18 +603,26 @@ static int parse_mountinfo_ent(char *str, struct proc_mountinfo *new)
 	...
-	ret = sscanf(str, "%31s %53s %63s", new->fstype, new->source, opt);
+	ret = sscanf(str, "%ms %ms %ms", &new->fstype, &new->source, &opt);
 	if (ret != 3)
 		return -1;
 
+	new->options = xmalloc(strlen(opt));
+	if (!new->options)

should not we have free(opt) here too? Not a big deal actually since
we usually exit on error and OS does free this memory anyway ;)

+		return -1;
+
 	if (parse_sb_opt(opt, &new->flags, new->options))
 		return -1;
 
+	free(opt);
+


More information about the CRIU mailing list