utils: Enable mount_setattr when compiling with older glibc - #785
Conversation
On some systems where bubblewrap is compiled/run it might happen that the kernel is new enough to have the `mount_setattr` syscall implemented, but the userspace side still needs `__NR_mount_setattr` explicitly defined to access it, because glibc may lag behind. Define a fallback definition of `__NR_mount_setattr` at least for some more common architectures to enable `mount_setattr`, on such systems. For instance, this enables the possible usage of `mount_setattr` with bubblewrap binaries compiled in the Steam Runtime SDK. Signed-off-by: Antonio Ospite <antonio.ospite@collabora.com>
|
cc @smcv |
smcv
left a comment
There was a problem hiding this comment.
LGTM, have you confirmed (using strace) that a bwrap compiled in a sufficiently old container still calls the mount_setattr syscall?
(For example you could compile in https://gitlab.steamos.cloud/steamrt/scout/sdk and run the resulting binary on a modern system)
Good idea, I'll do the
BTW it looks like we need the changes from #786 to be able to build in the scout SDK. |
|
@smcv I built on scout two binaries, one without the changes in MR, and one with the changes in MR applied, and things seem to work as expected: |
Great, let's apply this then. |
On some systems where bubblewrap is compiled/run it might happen that the kernel is new enough to have the
mount_setattrsyscall implemented, but the userspace side still needs__NR_mount_setattrexplicitly defined to access it, because glibc may lag behind.Define a fallback definition of
__NR_mount_setattrat least for some more common architectures to enablemount_setattr, on such systems.For instance, this enables the possible usage of
mount_setattrwith bubblewrap binaries compiled in the Steam Runtime SDK.