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
I've been trying to use the advanced nspawn features and came across a snag.
setexeccon() is failing with ENOENT.
After digging in with strace, it appears to be attempting to write to the exec context of the wrong thread.
I believe the reason for this is that libselinux caches this path, and invalidates it with an atfork() handler.
However, because glibc doesn't expose a low-level clone() interface, systemd does its own raw clone, hence the atfork() handlers are not called, so setexeccon() attempts to change the context of a process that does not exist.
I think our options are to either forego use of libselinux and write the context directly (I've tried this locally and it appears to work) or rework the uses of raw_clone to use the thread-centric clone provided by glibc.