qemu-e2k/scripts
Richard W.M. Jones 3d212b41e9 nbd/server: Add --selinux-label option
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>
2021-11-16 10:16:38 -06:00
..
ci Jobs based on custom runners: docs and gitlab-runner setup playbook 2021-07-14 14:31:48 +01:00
coccinelle softmmu/memory: Pass ram_flags to memory_region_init_ram_shared_nomigrate() 2021-06-15 20:27:38 +02:00
codeconverter
coverity-scan coverity-model: write models fully for non-array allocation functions 2021-07-30 12:04:01 +02:00
kvm
modules
oss-fuzz fuzz: add an instrumentation filter 2021-09-01 07:33:13 -04:00
performance
qapi qapi: Extend -compat to set policy for unstable interfaces 2021-10-29 21:28:01 +02:00
qemu-guest-agent
qemugdb
qmp scripts/qmp-shell: add redirection shim 2021-06-18 16:10:07 -04:00
simplebench iotests: Accommodate async QMP Exception classes 2021-11-01 11:54:59 -04:00
tracetool scripts/tracetool: Replace the word 'whitelist' 2021-03-09 22:14:26 +01:00
analyse-9p-simpletrace.py
analyse-locks-simpletrace.py
analyze-inclusions
analyze-migration.py analyze-migration.py: fix extract contents ('-x') errors 2021-10-23 20:28:56 +02:00
archive-source.sh
block-coroutine-wrapper.py block-coroutine-wrapper.py: support BlockBackend first argument 2021-10-15 15:51:33 -05:00
check_sparse.py
checkpatch.pl scripts/checkpatch: roll diff tweaking into checkpatch itself 2021-06-25 10:08:33 +01:00
clean-header-guards.pl
clean-includes
cleanup-trace-events.pl
cocci-macro-file.h
cpu-x86-uarch-abi.py scripts: helper to generate x86_64 CPU ABI compat info 2021-06-17 14:11:06 -04:00
decodetree.py decodetree: Extend argument set syntax to allow types 2021-05-01 11:45:35 -07:00
device-crash-test device-crash-test: Ignore errors about a bus not being available 2021-04-01 14:28:39 +02:00
disas-objdump.pl
dump-guest-memory.py
entitlement.sh meson: Use input/output for entitlements target 2021-07-09 18:21:34 +02:00
extract-vsssdk-headers
feature_to_c.sh
fix-multiline-comments.sh docs: move CODING_STYLE into the developer documentation 2021-02-24 11:05:21 +00:00
gensyscalls.sh
get_maintainer.pl
git-submodule.sh
git.orderfile
hxtool
hxtool-conv.pl
kernel-doc scripts/kernel-doc: strip QEMU_ from function definitions 2021-03-24 14:24:40 +00:00
make-release roms/edk2: Only initialize required submodules 2021-10-20 16:26:19 -07:00
meson-buildoptions.py meson: bump submodule to 0.59.3 2021-11-02 15:57:28 +01:00
meson-buildoptions.sh nbd/server: Add --selinux-label option 2021-11-16 10:16:38 -06:00
meson.build trace: move configuration from configure to Meson 2021-10-14 09:50:56 +02:00
minikconf.py
modinfo-collect.py modules: collect module meta-data 2021-07-09 18:20:27 +02:00
modinfo-generate.py modules: check if all dependencies can be satisfied 2021-07-09 18:20:27 +02:00
mtest2make.py meson: switch minimum meson version to 0.58.2, minimum recommended to 0.59.2 2021-10-05 13:10:29 +02:00
nsis.py
qapi-gen.py
qemu-binfmt-conf.sh scripts: fix generation update-binfmts templates 2021-05-03 10:07:41 +02:00
qemu-gdb.py
qemu-trace-stap qemu-trace-stap: changing SYSTEMTAP_TAPSET considered harmful. 2021-07-12 17:37:06 +01:00
qemu-version.sh
refresh-pxe-roms.sh
render_block_graph.py
replay-dump.py
shaderinclude.pl
signrom.py
simpletrace.py docs: fix references to docs/devel/tracing.rst 2021-06-02 06:51:09 +02:00
switch-timer-api
tap-driver.pl
tap-merge.pl
test-driver.py
tracetool.py
u2f-setup-gen.py
undefsym.py
update-linux-headers.sh headers: Add udmabuf.h 2021-05-27 12:06:37 +02:00
update-mips-syscall-args.sh linux-user, mips: update syscall-args-o32.c.inc to Linux v5.13 2021-07-13 13:59:59 +02:00
update-syscalltbl.sh
userfaultfd-wrlat.py
vmstate-static-checker.py