Libvirt provides a portable, long term stable C API for managing the virtualization technologies provided by many operating systems. It includes support for QEMU, KVM, Xen, LXC, bhyve, Virtuozzo, VMware vCenter and ESX, VMware Desktop, Hyper-V, VirtualBox and the POWER Hypervisor.
Go to file
Laine Stump 75056f61f1 security: make it possible to set SELinux label of child process from its binary
Normally when a child process is started by libvirt, the SELinux label
of that process is set to virtd_t (plus an MCS range). In at least one
case (passt) we need for the SELinux label of a child process label to
match the label that the binary would have transitioned to
automatically if it had been run standalone (in the case of passt,
that label is passt_t).

This patch modifies virSecuritySELinuxSetChildProcessLabel() (and all
the functions above it in the call chain) so that the toplevel
function can set a new argument "useBinarySpecificLabel" to true. If
it is true, then virSecuritySELinuxSetChildProcessLabel() will call
the new function virSecuritySELinuxContextSetFromFile(), which uses
the selinux library function security_compute_create() to determine
what would be the label of the new process if it had been run
standalone (rather than being run by libvirt) - the MCS range from the
normally-used label is added to this newly derived label, and that is
what is used for the new process rather than whatever is in the
domain's security label (which will usually be virtd_t).

In order to easily verify that nothing was broken by these changes to
the call chain, all callers currently set useBinarySpecificPath =
false, so all behavior should be completely unchanged. (The next
patch will set it to true only for the case of running passt.)

https://bugzilla.redhat.com/2172267
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2023-03-10 14:09:29 -05:00
.ctags.d
.github/workflows
.gitlab/issue_templates gitlab: issue_template: Remove labelling commands 2022-06-01 12:27:10 +02:00
build-aux syntax-check: Ensure Python is called via env(1) 2023-02-20 18:33:16 +01:00
ci ci: Regenerate gitlab CI config with latest lcitool 2023-03-01 14:42:19 +01:00
docs qemu: implement QEMU NBD source reconnect delay attribute 2023-03-10 09:38:05 +01:00
examples Fix some typos 2023-03-09 14:09:16 +01:00
include lib: Introduce virDomainFDAssociate API 2023-01-09 14:59:42 +01:00
po Translated using Weblate (Russian) 2023-03-10 09:40:04 +01:00
scripts scripts/apibuild: Extract and format API ACLs 2023-03-06 13:09:16 +01:00
src security: make it possible to set SELinux label of child process from its binary 2023-03-10 14:09:29 -05:00
tests libxl: Add support for custom firmware path in config converter 2023-03-10 11:02:02 -07:00
tools tools: Fix detection of remote libvirt access in virt-qemu-sev-validate 2023-02-03 11:28:56 -07:00
.ctags
.dir-locals.el
.editorconfig
.gitattributes Add .gitattributes file 2022-03-17 14:33:12 +01:00
.gitignore Revert ".gitignore: Ignore cscope and other *tags files" 2023-02-08 17:24:31 +01:00
.gitlab-ci.yml ci: potfile: Add 'variables' to definition 2022-10-11 10:18:04 +02:00
.gitmodules
.gitpublish
.mailmap
AUTHORS.rst.in AUTHORS: change my (Nikolay Shirokovskiy) email 2022-04-06 11:00:53 +03:00
config.h
configmake.h.in
CONTRIBUTING.rst
COPYING
COPYING.LESSER
gitdm.config
libvirt-admin.pc.in
libvirt-lxc.pc.in
libvirt-qemu.pc.in
libvirt.pc.in
libvirt.spec.in rpm: add missing deps for the virt-qemu-sev-validate 2023-02-22 13:48:48 +00:00
meson_options.txt Remove support for building the sheepdog storage driver backend 2022-09-01 13:11:09 +02:00
meson.build Post-release version bump to 9.2.0 2023-03-01 11:15:06 +01:00
NEWS.rst Fix some typos 2023-03-09 14:09:16 +01:00
README.rst
run.in run: gracefully handle SIGHUP, SIGQUIT, SIGTERM 2022-03-10 08:06:12 +00:00

GitLab CI Build Status

CII Best Practices

Translation status

Libvirt API for virtualization

Libvirt provides a portable, long term stable C API for managing the virtualization technologies provided by many operating systems. It includes support for QEMU, KVM, Xen, LXC, bhyve, Virtuozzo, VMware vCenter and ESX, VMware Desktop, Hyper-V, VirtualBox and the POWER Hypervisor.

For some of these hypervisors, it provides a stateful management daemon which runs on the virtualization host allowing access to the API both by non-privileged local users and remote users.

Layered packages provide bindings of the libvirt C API into other languages including Python, Perl, PHP, Go, Java, OCaml, as well as mappings into object systems such as GObject, CIM and SNMP.

Further information about the libvirt project can be found on the website:

https://libvirt.org

License

The libvirt C API is distributed under the terms of GNU Lesser General Public License, version 2.1 (or later). Some parts of the code that are not part of the C library may have the more restrictive GNU General Public License, version 2.0 (or later). See the files COPYING.LESSER and COPYING for full license terms & conditions.

Installation

Instructions on building and installing libvirt can be found on the website:

https://libvirt.org/compiling.html

Contributing

The libvirt project welcomes contributions in many ways. For most components the best way to contribute is to send patches to the primary development mailing list. Further guidance on this can be found on the website:

https://libvirt.org/contribute.html

Contact

The libvirt project has two primary mailing lists:

Further details on contacting the project are available on the website:

https://libvirt.org/contact.html