From a5875ece5944de36fba6cd13a46dd9187e84534f Mon Sep 17 00:00:00 2001 From: Kirill Tkhai Date: Tue, 13 Sep 2016 17:50:05 +0300 Subject: [PATCH] mount: Prohibit second binfmt_misc superblock This is need to catch the moment when binfmt_misc in mainline kernel is virtualized Signed-off-by: Kirill Tkhai Signed-off-by: Pavel Emelyanov --- criu/mount.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/criu/mount.c b/criu/mount.c index 7fd9b0a88..adc9a8598 100644 --- a/criu/mount.c +++ b/criu/mount.c @@ -1461,6 +1461,7 @@ err: static int binfmt_misc_dump(struct mount_info *pm) { + static bool dumped = false; struct cr_img *img = NULL; struct dirent *de; DIR *fdir = NULL; @@ -1470,6 +1471,12 @@ static int binfmt_misc_dump(struct mount_info *pm) if (ret <= 0) return ret; + if (dumped) { + pr_err("Second binfmt_misc superblock\n"); + return -1; + } + dumped = true; + fd = open_mountpoint(pm); if (fd < 0) return fd;