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
Does it cause a user-visible bug for the permissions to be different? If yes: what can you do to reproduce that bug, what do you expect to happen, and what actually happens?
I don't think we should be setting world-writable permissions on directories unless there is a concrete reason why it is a good idea to do so.
It caused a bug when I fiddled around with running a demon. With bwrap [...] runuser -u http -- [...] the daemon couldn't access /dev/shm because it was 755 and owned by root. I gave up that approach in favor of running bubblewrap as setuid, so this issue is not relevant to me any more.
Is that running bwrap as (real and effective) uid root?
That isn't really what bwrap is designed for: bwrap is primarily designed to be runnable by unprivileged users, either by being setuid root (as it is on Debian and CentOS/RHEL) or by having your kernel configured to allow unprivileged users to create new user namespaces (as on Fedora and Ubuntu). Its typical uses are in things like Flatpak, GNOME thumbnailers and WebKitGTK, which run as an ordinary human user (not a system user like http) and use bwrap to protect that user's other processes from the sandboxed Flatpak app, thumbnailer or WebKit content process.
runuser -u http -- bwrap ... would be closer to that pattern.
In those cases, /dev/shm inside the container will be 0755 and owned by the user who started bwrap, so it doesn't need permissions that open it up to other users.
If you're already root and fully-privileged, then you can create new namespaces with unshare(2) and configure them however you want, without needing bwrap. For example, this is how unshare(1), Docker, lxc and various systemd unit properties like ProtectSystem are implemented.
That isn't really what bwrap is designed for: bwrap is primarily designed to be runnable by unprivileged users,
Yes, but I think we should support the privileged case too.
If you're already root and fully-privileged, then you can create new namespaces with unshare(2) and configure them however you want, without needing bwrap. For example, this is how unshare(1), Docker, lxc and various systemd unit properties like ProtectSystem are implemented.
Sure, but doing all that "by hand" is exactly what bwrap is much better at - including the usual subtleties like running a proper init in the pid namespace.
Created directory permissions are more generic issue than /dev/shm. Bublewrap sandbox is unusable with Qt 5.14+ due to non canonical runtime dir path permissions. Implementing #346 would be best fix IMO.
This is the wrong way round: order matters. You're mounting a tmpfs with the wider permissions on /dev/shm, but then mounting a minimal /dev (which I think might include its own /dev/shm) over the top of that. Reversing the order of these two lines should work.
This is the wrong way round: order matters. You're mounting a tmpfs with the wider permissions on /dev/shm, but then mounting a minimal /dev (which I think might include its own /dev/shm) over the top of that. Reversing the order of these two lines should work.
Activity
smcv commentedon Oct 11, 2019
Does it cause a user-visible bug for the permissions to be different? If yes: what can you do to reproduce that bug, what do you expect to happen, and what actually happens?
I don't think we should be setting world-writable permissions on directories unless there is a concrete reason why it is a good idea to do so.
casipw commentedon Oct 11, 2019
It caused a bug when I fiddled around with running a demon. With
bwrap [...] runuser -u http -- [...]the daemon couldn't access/dev/shmbecause it was755and owned by root. I gave up that approach in favor of running bubblewrap as setuid, so this issue is not relevant to me any more.toralf commentedon Jul 12, 2020
In Gentoo we do have https://bugs.gentoo.org/496328 (python compiling fails) if /dev/shm does not have 1777 set - so it would be good to have the option to set perms on /dev/shm via command line rather than doing something like
here (eg as in toralf/tinderbox@c8bc109)
smcv commentedon Jul 12, 2020
Is that running bwrap as (real and effective) uid root?
That isn't really what bwrap is designed for: bwrap is primarily designed to be runnable by unprivileged users, either by being setuid root (as it is on Debian and CentOS/RHEL) or by having your kernel configured to allow unprivileged users to create new user namespaces (as on Fedora and Ubuntu). Its typical uses are in things like Flatpak, GNOME thumbnailers and WebKitGTK, which run as an ordinary human user (not a system user like http) and use bwrap to protect that user's other processes from the sandboxed Flatpak app, thumbnailer or WebKit content process.
runuser -u http -- bwrap ...would be closer to that pattern.In those cases,
/dev/shminside the container will be 0755 and owned by the user who started bwrap, so it doesn't need permissions that open it up to other users.If you're already root and fully-privileged, then you can create new namespaces with unshare(2) and configure them however you want, without needing bwrap. For example, this is how unshare(1), Docker, lxc and various systemd unit properties like
ProtectSystemare implemented.cgwalters commentedon Jul 12, 2020
Yes, but I think we should support the privileged case too.
Sure, but doing all that "by hand" is exactly what
bwrapis much better at - including the usual subtleties like running a properinitin the pid namespace.Today rpm-ostree uses
bwraprunning fully privileged FWIW.(On this particular bug...I can't see a reason not to mirror the host's permissions for
/dev/shm)Maryse47 commentedon Jul 13, 2020
Created directory permissions are more generic issue than
/dev/shm. Bublewrap sandbox is unusable with Qt 5.14+ due to non canonical runtime dir path permissions. Implementing #346 would be best fix IMO.Implement --perms and --chmod
smcv commentedon Feb 16, 2021
#406 implements options that would let you use
--perms 1777 --tmpfs /dev/shm.The default continues to be 0755 to avoid behaviour changes.
Implement --perms and --chmod
Implement --perms and --chmod
Implement --perms and --chmod
Implement --perms and --chmod
Implement --perms and --chmod
fix an permission error
fix a permission error
fix a permission error
toralf commentedon Aug 21, 2021
Hhm, 0.5.0 mention that it has this issue fixed, but:
I do call it:
as seen here : https://github.com/toralf/tinderbox/blob/master/bin/bwrap.sh#L147
smcv commentedon Aug 21, 2021
This is the wrong way round: order matters. You're mounting a tmpfs with the wider permissions on /dev/shm, but then mounting a minimal /dev (which I think might include its own /dev/shm) over the top of that. Reversing the order of these two lines should work.
toralf commentedon Aug 21, 2021
indeed - thx !
Implement --perms and --chmod
Implement --perms and --chmod