[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2] nbd/server: Add --selinux-label option
From: |
Kevin Wolf |
Subject: |
Re: [PATCH v2] nbd/server: Add --selinux-label option |
Date: |
Fri, 23 Jul 2021 18:18:55 +0200 |
Am 23.07.2021 um 12:33 hat Richard W.M. Jones geschrieben:
> 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>
I suppose this would also be relevant for the built-in NBD server,
especially in the context of qemu-storage-daemon?
If so, is this something specific to NBD sockets, or would it actually
make sense to have it as a generic option in UnixSocketAddress?
Kevin