• Pavel Tikhomirov's avatar
    mount: fix segmentation fault in can_mount_now on no mnt_master · 69663091
    Pavel Tikhomirov authored
    In resolve_shared_mounts there are cases when we have m->master_id > 0
    but m->mnt_master is not set, it happens for cases where we have no
    access to master mount, for instance CT root m->parent==NULL or when
    mount is external. In can_mount_now  for such master mounts we don't
    need to check mounted state also, so just use "if(mi->mnt_master)"
    condition instead of "if(mi->master_id > 0)" to fix segfault.
    
    https://jira.sw.ru/browse/PSBM-86978
    
    Program terminated with signal 11, Segmentation fault.
    0x000000000046328b in can_mount_now (mi=0x2155970) at criu/mount.c:2699
    2699	list_for_each_entry(c, &mi->mnt_master->children, siblings)
    
    (gdb) p mi->mnt_master
    $2 = (struct mount_info	*) 0x0
    
    Fixes commit 3a02362c5be1 ("mount: fix can_mount_now to wait children of
    master's share properly")
    Signed-off-by: 's avatarPavel Tikhomirov <ptikhomirov@virtuozzo.com>
    Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
    69663091
Name
Last commit
Last update
Documentation Loading commit data...
compel Loading commit data...
contrib Loading commit data...
coredump Loading commit data...
crit Loading commit data...
criu Loading commit data...
images Loading commit data...
include/common Loading commit data...
lib Loading commit data...
scripts Loading commit data...
soccr Loading commit data...
test Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
COPYING Loading commit data...
CREDITS Loading commit data...
INSTALL.md Loading commit data...
Makefile Loading commit data...
Makefile.compel Loading commit data...
Makefile.config Loading commit data...
Makefile.install Loading commit data...
Makefile.versions Loading commit data...
README.md Loading commit data...