[CRIU] [PATCH] fsnotify: Fix nil dereference in pre_dump_one_fanotify

Cyrill Gorcunov gorcunov at openvz.org
Tue Mar 11 01:08:48 PDT 2014


pre_dump_one_fanotify calls for parse_fdinfo_pid_s where
fsn_params mut not be NULL, otherwise we get nil dereference.

Fix it by passing a real variable instead.

Reported-by: Pavel Tikhomirov <snorcht at gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 fsnotify.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fsnotify.c b/fsnotify.c
index 3cb06a275dac..77e2d0d79b1a 100644
--- a/fsnotify.c
+++ b/fsnotify.c
@@ -314,7 +314,8 @@ static int pre_dump_fanotify_entry(union fdinfo_entries *e, void *arg)
 
 static int pre_dump_one_fanotify(int pid, int lfd)
 {
-	return parse_fdinfo_pid(pid, lfd, FD_TYPES__FANOTIFY, pre_dump_fanotify_entry, NULL);
+	struct fsnotify_params fsn_params = { };
+	return parse_fdinfo_pid(pid, lfd, FD_TYPES__FANOTIFY, pre_dump_fanotify_entry, &fsn_params);
 }
 
 const struct fdtype_ops fanotify_dump_ops = {
-- 
1.8.3.1



More information about the CRIU mailing list