mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-02 07:15:31 +00:00
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 <ktkhai@virtuozzo.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
6e83f54314
commit
a5875ece59
@@ -1461,6 +1461,7 @@ err:
|
|||||||
|
|
||||||
static int binfmt_misc_dump(struct mount_info *pm)
|
static int binfmt_misc_dump(struct mount_info *pm)
|
||||||
{
|
{
|
||||||
|
static bool dumped = false;
|
||||||
struct cr_img *img = NULL;
|
struct cr_img *img = NULL;
|
||||||
struct dirent *de;
|
struct dirent *de;
|
||||||
DIR *fdir = NULL;
|
DIR *fdir = NULL;
|
||||||
@@ -1470,6 +1471,12 @@ static int binfmt_misc_dump(struct mount_info *pm)
|
|||||||
if (ret <= 0)
|
if (ret <= 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
if (dumped) {
|
||||||
|
pr_err("Second binfmt_misc superblock\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
dumped = true;
|
||||||
|
|
||||||
fd = open_mountpoint(pm);
|
fd = open_mountpoint(pm);
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
return fd;
|
return fd;
|
||||||
|
Reference in New Issue
Block a user