lsetxattr() working inside a rootful containerchconlabel=nested: Allows SELinux modifications within the container. Containers are allowed to modify SELinux labels on files and processes, as long as SELinux policy allows. Without nested, containers view SELinux as disabled, even when it is enabled on the host. Containers are prevented from setting any labels.
To mount a file system with the specified context, overriding existing contexts if they exist, or to specify a different, default context for a file system that does not support extended attributes, as the root user, use the mount -o context=SELinux_user:role:type:level command when mounting the required file system.
Newly-created files and directories on this file system appear to have the SELinux context specified with -o context. However, since these changes are not written to disk, the context specified with this option does not persist between mounts.
--rootfs /:O mounts the rootfs from your current system into a temporary overlay(rw) then puts you inside thatostree_sepolicy_restorecon() might be buggy from ostreerestoreconsudo podman run \
--privileged \
--rm -it \
--security-opt label=disable \
-v /sys/fs/selinux:/sys/fs/selinux \
-v /etc/selinux/config:/etc/selinux/config:ro \
--userns=host \
-v "$HOME:$HOME" \
--rootfs /:O \
/bin/bash