#1034485 os-prober expects to run in a new private mount namespace, but new namespace is not private

Package:
os-prober
Source:
os-prober
Description:
utility to detect other OSes on a set of drives
Submitter:
Olivier Gayot
Date:
2023-04-16 16:39:03 UTC
Severity:
normal
#1034485#5
Date:
2023-04-16 16:16:12 UTC
From:
To:
Dear Maintainer,

During execution of os-prober, other processes on the system can see the
temporary mounts to /var/lib/os-prober/mount even though os-prober runs
in a separate mount namespace.

In order to run os-prober in a more isolated mode, we introduced the
newns.c source file a while ago. We build it to a binary and ship it in
os-prober and os-prober-udeb.

The original idea was to run os-prober in a private mount namespace.
Sadly, calling the unshare(CLONE_NEWNS) system call is only enough to
create a new mount namespace. But it is not enough to make the new
namespace private.

While we can patch newns.c to make the new mount namespace private,
relying on unshare(1) from util-linux (which is an essential package)
seems like a more viable option.

I will open a PR with a potential fix.

Thanks,
Olivier

See also:

https://github.com/util-linux/util-linux/commit/f0f22e9c6f109f8c1234caa3173368ef43b023eb

#1034485#10
Date:
2023-04-16 16:30:42 UTC
From:
To:
Dear maintainer,

I opened the following PR:

https://salsa.debian.org/installer-team/os-prober/-/merge_requests/20

Best regards,
Olivier