[CRIU] [PATCH] kdat: fill kdat by zero-s before initializing it

Andrei Vagin avagin at virtuozzo.com
Tue May 15 22:52:57 MSK 2018


kerndat_try_load_cache() fills kdat from /run/criu.kdat,
so it will contain some trash, if criu.kdat isn't compatible with the
current version of criu.

Signed-off-by: Andrei Vagin <avagin at virtuozzo.com>
---
 criu/kerndat.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/criu/kerndat.c b/criu/kerndat.c
index ba8d93808..8cb569016 100644
--- a/criu/kerndat.c
+++ b/criu/kerndat.c
@@ -973,6 +973,9 @@ int kerndat_init(void)
 	if (ret <= 0)
 		return ret;
 
+	/* kerndat_try_load_cache can leave some trash in kdat */
+	memset(&kdat, 0, sizeof(kdat));
+
 	preload_socket_modules();
 	preload_netfilter_modules();
 
-- 
2.14.3



More information about the CRIU mailing list