Commit a5875ece authored by Kirill Tkhai's avatar Kirill Tkhai Committed by Pavel Emelyanov

mount: Prohibit second binfmt_misc superblock

This is need to catch the moment when binfmt_misc in mainline kernel is virtualized
Signed-off-by: 's avatarKirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 6e83f543
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment