Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions bubblewrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -2227,6 +2227,15 @@ main (int argc,
if (max_user_ns != NULL && strcmp(max_user_ns, "0\n") == 0)
disabled = TRUE;
}

/* Check if /proc is mounted with hidepid=1 or hidepid=2 */
if (stat ("/proc/mounts", &sbuf) == 0)
{
cleanup_free char *hidepid = NULL;
hidepid = load_file_at (AT_FDCWD, "/proc/mounts");
if (strstr(hidepid, "hidepid=") != NULL)
disabled = TRUE;
}

/* Debian lets you disable *unprivileged* user namespaces. However this is not
a problem if we're privileged, and if we're not opt_unshare_user is TRUE
Expand Down