From 94bfda900ee43adbd67a8bca5fd838e4aca5ff99 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Thu, 31 Mar 2016 17:39:43 +0300 Subject: [PATCH] cg: Fix use-after-free in put_ctls Since we're freeing list entries don't forget to initialize list then, otherwise it gets out with free entries and may hit use-after-free bug. Signed-off-by: Cyrill Gorcunov Acked-by: Tycho Andersen Signed-off-by: Pavel Emelyanov --- criu/proc_parse.c | 1 + 1 file changed, 1 insertion(+) diff --git a/criu/proc_parse.c b/criu/proc_parse.c index 24a915498..4522ce67e 100644 --- a/criu/proc_parse.c +++ b/criu/proc_parse.c @@ -2302,6 +2302,7 @@ void put_ctls(struct list_head *l) xfree(c->path); xfree(c); } + INIT_LIST_HEAD(l); } /* Parse and create all the real controllers. This does not include things with