containers / bubblewrap

Low-level unprivileged sandboxing tool used by Flatpak and similar projects
Other
3.99k stars 239 forks source link

`--block-fd` does not work #635

Closed M83tUt3 closed 5 months ago

M83tUt3 commented 5 months ago

I'm having issues getting --block-fd to work. It's not actually blocking the sandbox in any way I've tried. Minimal example:

bwrap --ro-bind / / --block-fd 9999 /usr/bin/sh # fd 9999 does not exist

The expectation is that the sandbox blocks, but it does not.

I do not really know C but I think the issue is in the TEMP_FAILURE_RETRY macro. It seems to only loop when the given expression (read in this case) exits with EINTR, which seems inappropiate here.

https://github.com/containers/bubblewrap/blob/8e51677abd7e3338e4952370bf7d902e37d8cbb6/bubblewrap.c#L47-L54

https://github.com/containers/bubblewrap/blob/8e51677abd7e3338e4952370bf7d902e37d8cbb6/bubblewrap.c#L3261-L3266

M83tUt3 commented 5 months ago

nvm fixed it