You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Depending on the options that it's given, the new namespaces created by bubblewrap might be:
a sandboxed environment, with a security boundary between the real system and the sandbox (for example Flatpak uses it this way when running the actual app)
a non-sandboxed environment, with differences between the real system and the sandbox, but no meaningful security boundary (for example Flatpak uses it this way when running xdg-dbus-proxy, and the Steam Runtime uses it this way when running Steam games)
If there is meant to be a security boundary, lots of features of bubblewrap need to "fail closed". For example, if we are told to provide a filesystem, and we fail to remount it ro or nosuid, then our only choice is to refuse to run the wrapped program (fail closed), because if we carried on anyway (fail open) then we would not be providing the intended security properties.
However, if there is not meant to be a security boundary, for a lot of failures we can consider ignoring the failure (possibly with a warning) and carrying on anyway.
At the moment, bubblewrap has no way to tell which of these security models the user of bubblewrap is looking for, so we have to make the conservative/pessimistic assumption that they do want a security boundary, and fail closed.
However, if we added a --not-a-security-boundary option, we could use it to make bubblewrap more robust in the cases where something unexpected goes wrong, such as #650. Pseudocode:
if (a thing fails)
{
if (not_a_security_boundary)
warn ("the thing failed (%s), continuing without doing the thing", strerror (errno));
else
die_with_error ("the thing failed");
}
Reacted by Anto, Samuel, jicksaw, wldhx, patlefort, Igor, David Rapisarda, niko and n0099
This would be a desired feature for a large part of the AppImages community, AppBundle community, NixAppImage project, and others. It'd be great to have this :)
@smcv would it make sense for this option to also not set PR_SET_NO_NEW_PRIVS? In particular I am thinking of executing programs that have cap_sys_nice set on them (in order for them to be able to set real time priority for some of their threads) not working in bwrap.
For example, adding cap_sys_nice to chrt to demonstrate this
would it make sense for this option to also not set PR_SET_NO_NEW_PRIVS?
No. In the presence of user namespaces, setcap can't work the way you expect it to anyway.
In particular I am thinking of executing programs that have cap_sys_nice set on them (in order for them to be able to set real time priority for some of their threads) not working in bwrap
This can't work the way you hope it does. The kernel's data model is that each process can only have capabilities in the "innermost" user namespace; and to be able to do its job, bubblewrap needs to create a new user namespace.
This means that the most-capable your process inside the container can possibly be is to have CAP_SYS_NICE in the user namespace that was created by bubblewrap. It cannot have CAP_SYS_NICE in the "init namespace" (the namespace where the kernel started init), which is the requirement for being allowed to set real-time priority on yourself.
Instead, you'll need to send D-Bus messages to RealtimeKit, the Realtime portal or a similar service outside the container, and ask it to give your threads real-time priority "from outside".
Activity
smcv commentedon Sep 9, 2024
cc @refi64
xplshn commentedon Oct 30, 2024
This would be a desired feature for a large part of the AppImages community, AppBundle community, NixAppImage project, and others. It'd be great to have this :)
xplshn commentedon Nov 27, 2024
rusty-snake commentedon Nov 27, 2024
smcv commentedon Nov 27, 2024
xplshn commentedon Nov 27, 2024
smcv commentedon Apr 24, 2026
As well as mitigating #650, this would likely be useful for coping gracefully with automounts, for example:
ao2 commentedon May 11, 2026
A draft implementation of
--not-a-security-boundarycan be found in #751bubblewrap: Add `--not-a-security-boundary` flag to enable fail-open …
bubblewrap: Add `--not-a-security-boundary` flag to enable fail-open …
bubblewrap: Add `--not-a-security-boundary` flag to enable fail-open …
bubblewrap: Add `--not-a-security-boundary` flag to enable fail-open …
ao2 commentedon Jun 15, 2026
This change should also address #541
twhitehead commentedon Jul 31, 2026
@smcv would it make sense for this option to also not set
PR_SET_NO_NEW_PRIVS? In particular I am thinking of executing programs that havecap_sys_niceset on them (in order for them to be able to set real time priority for some of their threads) not working in bwrap.For example, adding
cap_sys_nicetochrtto demonstrate thisIt runs okay outside of
bwrapbut fails inside of
bwrapsmcv commentedon Jul 31, 2026
No. In the presence of user namespaces, setcap can't work the way you expect it to anyway.
This can't work the way you hope it does. The kernel's data model is that each process can only have capabilities in the "innermost" user namespace; and to be able to do its job, bubblewrap needs to create a new user namespace.
This means that the most-capable your process inside the container can possibly be is to have
CAP_SYS_NICEin the user namespace that was created by bubblewrap. It cannot haveCAP_SYS_NICEin the "init namespace" (the namespace where the kernel started init), which is the requirement for being allowed to set real-time priority on yourself.Instead, you'll need to send D-Bus messages to RealtimeKit, the Realtime portal or a similar service outside the container, and ask it to give your threads real-time priority "from outside".