3d212b41e9
Under SELinux, Unix domain sockets have two labels. One is on the disk and can be set with commands such as chcon(1). There is a different label stored in memory (called the process label). This can only be set by the process creating the socket. When using SELinux + SVirt and wanting qemu to be able to connect to a qemu-nbd instance, you must set both labels correctly first. For qemu-nbd the options to set the second label are awkward. You can create the socket in a wrapper program and then exec into qemu-nbd. Or you could try something with LD_PRELOAD. This commit adds the ability to set the label straightforwardly on the command line, via the new --selinux-label flag. (The name of the flag is the same as the equivalent nbdkit option.) A worked example showing how to use the new option can be found in this bug: https://bugzilla.redhat.com/show_bug.cgi?id=1984938 Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1984938 Signed-off-by: Richard W.M. Jones <rjones@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> [eblake: rebase to configure changes, reject --selinux-label if it is not compiled in or not used on a Unix socket] Note that we may relax some of these restrictions at a later date, such as making it possible to label a TCP socket, although it may be smarter to do so as a generic QMP action rather than more one-off command lines in qemu-nbd. Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <20211115202944.615966-1-eblake@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> [eblake: adjust meson output as suggested by thuth] Signed-off-by: Eric Blake <eblake@redhat.com> |
||
---|---|---|
.. | ||
debian-hexagon-cross.docker.d | ||
debian-microblaze-cross.d | ||
debian-nios2-cross.d | ||
alpine.docker | ||
centos8.docker | ||
debian10.docker | ||
debian11.docker | ||
debian-all-test-cross.docker | ||
debian-alpha-cross.docker | ||
debian-amd64-cross.docker | ||
debian-amd64.docker | ||
debian-arm64-cross.docker | ||
debian-arm64-test-cross.docker | ||
debian-armel-cross.docker | ||
debian-armhf-cross.docker | ||
debian-bootstrap.docker | ||
debian-bootstrap.pre | ||
debian-hexagon-cross.docker | ||
debian-hppa-cross.docker | ||
debian-m68k-cross.docker | ||
debian-mips64-cross.docker | ||
debian-mips64el-cross.docker | ||
debian-mips-cross.docker | ||
debian-mipsel-cross.docker | ||
debian-native.docker | ||
debian-powerpc-test-cross.docker | ||
debian-ppc64el-cross.docker | ||
debian-riscv64-cross.docker | ||
debian-s390x-cross.docker | ||
debian-sh4-cross.docker | ||
debian-sparc64-cross.docker | ||
debian-toolchain.docker | ||
debian-tricore-cross.docker | ||
debian-xtensa-cross.docker | ||
empty.docker | ||
fedora-cris-cross.docker | ||
fedora-i386-cross.docker | ||
fedora-win32-cross.docker | ||
fedora-win64-cross.docker | ||
fedora.docker | ||
opensuse-leap.docker | ||
python.docker | ||
ubuntu1804.docker | ||
ubuntu2004.docker | ||
ubuntu.docker |