From: Dmitry Yakunin Date: Thu, 8 Oct 2020 17:59:27 +0000 (+0300) Subject: lib: ignore invalid mounts in cg_init_map X-Git-Tag: v5.9.0~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58c3c55f3888fd2482545dfc902b9cb38458e404;p=thirdparty%2Fiproute2.git lib: ignore invalid mounts in cg_init_map In case of bad entries in /proc/mounts just skip cgroup cache initialization. Cgroups in output will be shown as "unreachable:cgroup_id". Fixes: d5e6ee0dac64 ("ss: introduce cgroup2 cache and helper functions") Signed-off-by: Dmitry Yakunin Reported-by: Donald Sharp Signed-off-by: Stephen Hemminger --- diff --git a/lib/cg_map.c b/lib/cg_map.c index 77f030e38..39f244dbc 100644 --- a/lib/cg_map.c +++ b/lib/cg_map.c @@ -96,11 +96,10 @@ static void cg_init_map(void) mnt = find_cgroup2_mount(false); if (!mnt) - exit(1); + return; mntlen = strlen(mnt); - if (nftw(mnt, nftw_fn, 1024, FTW_MOUNT) < 0) - exit(1); + (void) nftw(mnt, nftw_fn, 1024, FTW_MOUNT); free(mnt); }