Skip to content

Read /proc/self/mounts when /etc/mtab is missing - #2474

Open
0intro wants to merge 1 commit into
OpenSCAP:mainfrom
0intro:djc/fsdev-proc-self-mounts
Open

0intro wants to merge 1 commit into
OpenSCAP:mainfrom
0intro:djc/fsdev-proc-self-mounts

Conversation

@0intro

@0intro 0intro commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

fsdev_init reads the local file systems from /etc/mtab, which on
Linux is a link to /proc/self/mounts. containerd 1.7.18 and
podman 1.6.4 create containers without the link, and in them every
object with recurse_file_system="local" comes out "does not exist":
a check that no such file exists passes.

fsdev_init reads the local file systems from /etc/mtab, which on
Linux is a link to /proc/self/mounts. containerd 1.7.18 and
podman 1.6.4 create containers without the link, and in them every
object with recurse_file_system="local" comes out "does not exist":
a check that no such file exists passes.
@0intro
0intro force-pushed the djc/fsdev-proc-self-mounts branch from 024c6c9 to 26c2514 Compare October 29, 2026 20:51
@sonarqubecloud

Copy link
Copy Markdown

@jamesconwaydev

Copy link
Copy Markdown

I reproduced this through oscap oval eval rather than the unit test. Fedora 44 arm64 container, main at 099cd84 against this branch at 26c2514. The OVAL is a file_test with check_existence="at_least_one_exists", and a file_object with recurse_file_system="local" on a directory where the file does exist:

/etc/mtab main this branch
normal symlink true true
removed false, object flag does not exist true, flag complete
dangling symlink false true
empty regular file false false

The dangling link is covered too. An empty regular file still gives false, which looks out of scope here but seemed worth mentioning.

ctest -R fsdev passes on the branch. As far as I can see fsdev.c is the only place reading the mtab path, since partition_probe.c and selinuxboolean_probe.c use /proc/mounts.

I removed the link by hand instead of running containerd 1.7.18 or podman 1.6.4, so that part I'm taking from your description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants