Re: [PATCH 3/4] virsecretobj: Encrypt/decrypt secrets using TPM

2024-02-13 Thread Ján Tomko
On a Tuesday in 2024, Michal Privoznik wrote: If user requests their virSecret value to be encrypted using hosts' TPM we can now honour such request as we have all the APIs ready. The value is still stored in a file (obj->base64File) but because it was encrypted by TPM it's not readable (even tho

Re: [libvirt PATCH v2 2/3] build: Add userfaultfd_sysctl build option

2024-02-13 Thread Ján Tomko
On a Tuesday in 2024, Jiri Denemark wrote: On Tue, Feb 13, 2024 at 18:48:59 +0100, Jiri Denemark wrote: I didn't explicitly test mingw builds, but I tested running meson setup with all combinations, especially with -Dsysctl_config=disabled and not specifying userfaultfd_sysctl option at all and

[PATCH 1/2] conf: add locking option to disk source

2024-02-13 Thread Hiroki Narukawa
There is a case that locking hits a bug and users wants to disable locking like bug in Linux kernel. This commit adds option to configure locking for file source. Signed-off-by: Hiroki Narukawa --- docs/formatdomain.rst | 5 + src/conf/domain_conf.c| 8 src/

[PATCH 0/2] Add locking option for disk

2024-02-13 Thread Hiroki Narukawa
There is a case that Linux has a bug and unlocking does not work properly like this: https://lore.kernel.org/lkml/20230608084609.14245-1-zhangjiachen.jay...@bytedance.com/T/ Especiall in the situation that live migration source node has this kind of bug, destination must not locking, or otherwis

[PATCH 2/2] qemu_block: add locking option

2024-02-13 Thread Hiroki Narukawa
There is a case that locking hits a bug and users wants to disable locking like bug in Linux kernel. This commit adds actual qemu option to the domain conf added in previous commit. Signed-off-by: Hiroki Narukawa --- src/qemu/qemu_block.c | 7 ++ tests/qemublocktest

Re: [PATCH 1/4] chardev/parallel: Don't close stdin on inappropriate device

2024-02-13 Thread Marc-André Lureau
Hi On Tue, Feb 13, 2024 at 5:58 PM Markus Armbruster wrote: > > Markus Armbruster writes: > > > The __linux__ version of qemu_chr_open_pp_fd() tries to claim the > > parport device with a PPCLAIM ioctl(). On success, it stores the file > > descriptor in the chardev object, and returns success.

[PUSHED PATCH] spec: Explicitly disable userfaultfd_sysctl for mingw

2024-02-13 Thread Jiri Denemark
The %meson* macros pass --auto-features=enabled to enable all "auto" features, which means we have to explicitly disable them. Signed-off-by: Jiri Denemark --- Notes: Pushed as a build breaker. libvirt.spec.in | 1 + 1 file changed, 1 insertion(+) diff --git a/libvirt.spec.in b/libvirt.sp

Re: [libvirt PATCH v2 2/3] build: Add userfaultfd_sysctl build option

2024-02-13 Thread Jiri Denemark
On Tue, Feb 13, 2024 at 18:48:59 +0100, Jiri Denemark wrote: > On Tue, Feb 13, 2024 at 11:39:26 +0100, Jiri Denemark wrote: > > This option controls whether the sysctl config for enabling unprivileged > > userfaultfd will be installed. > > > > Signed-off-by: Jiri Denemark > > --- > > meson.build

Re: [libvirt PATCH v2 2/3] build: Add userfaultfd_sysctl build option

2024-02-13 Thread Jiri Denemark
On Tue, Feb 13, 2024 at 11:39:26 +0100, Jiri Denemark wrote: > This option controls whether the sysctl config for enabling unprivileged > userfaultfd will be installed. > > Signed-off-by: Jiri Denemark > --- > meson.build | 8 > meson_options.txt| 1 + > src/qemu/meson.buil

Re: gitlab pages hosting for libvirt.org

2024-02-13 Thread Peter Krempa
On Wed, Feb 07, 2024 at 11:22:09 +0100, Peter Krempa wrote: [...] > Later today or tomorrow I'll push the already-reviewed patch: > > > https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/message/FFYC3ZYV5MOWJBKOKMUJTYPPHGNNLOJU/ > > which will switch over the redirect rule prefix

[PATCH 4/4] NEWS: Document new virSecret TPM feature

2024-02-13 Thread Michal Privoznik
Signed-off-by: Michal Privoznik --- NEWS.rst | 6 ++ 1 file changed, 6 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 15b0da31b6..9c0e4b4b65 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -30,6 +30,12 @@ v10.1.0 (unreleased) to resolve names of the connected guests using the name server

[PATCH 3/4] virsecretobj: Encrypt/decrypt secrets using TPM

2024-02-13 Thread Michal Privoznik
If user requests their virSecret value to be encrypted using hosts' TPM we can now honour such request as we have all the APIs ready. The value is still stored in a file (obj->base64File) but because it was encrypted by TPM it's not readable (even though it's still base64 encoded). And since we ca

[PATCH 2/4] conf: Introduce @tpm attribute to

2024-02-13 Thread Michal Privoznik
This attribute exists next to @ephemeral and @private attributes and controls whether the secret value is encrypted using system's TPM chip before stored on disk. Obviously, it's mutually exclusive with @ephemeral which forces us to keep the secret value in memory only. In the long run, we can eve

[PATCH 1/4] virsecret: Introduce APIs to talk to systemd-cred

2024-02-13 Thread Michal Privoznik
The systemd-cred offers a convenient way to talk to host's TPM. While its original intent is to be used in systemd unit files, it offers two additional commands: encrypt and decrypt that can be used independent of the rest of systemd. And these are the ones we need. They offer a convenient way to e

[PATCH 0/4] Protect secret values stored on disk with TPM

2024-02-13 Thread Michal Privoznik
Secret values are stored effectively in plaintext on a disk and we rely on file perms to secure them. But with systemd-cred we can use system's TPM chip and encrypt them. Such secrets won't be transferable to another system by simply copying files stored on disk, but: a) that's not recommended way

Re: [PATCH 0/4] secret: Modernize XML parsing and formatting

2024-02-13 Thread Ján Tomko
On a Tuesday in 2024, Michal Privoznik wrote: Couple of things happening here: 1) add a missing case to our polkit checks 2) modernize XML parsing and formatting, so that the code is prepared for a new feature I'm working on. Michal Prívozník (4): viraccessdriverpolkit: Add missing vtpm case

Re: [PATCH 1/4] chardev/parallel: Don't close stdin on inappropriate device

2024-02-13 Thread Markus Armbruster
Markus Armbruster writes: > The __linux__ version of qemu_chr_open_pp_fd() tries to claim the > parport device with a PPCLAIM ioctl(). On success, it stores the file > descriptor in the chardev object, and returns success. On failure, it > closes the file descriptor, and returns failure. > > ch

Re: [libvirt PATCH v2 0/3] qemu: Add support for /dev/userfaultfd

2024-02-13 Thread Ján Tomko
On a Tuesday in 2024, Jiri Denemark wrote: Jiri Denemark (3): qemu: Add support for /dev/userfaultfd build: Add userfaultfd_sysctl build option spec: Disable with_userfaultfd_sysctl on Fedora and RHEL-9 libvirt.spec.in| 16 +++ meson.build|

[PATCH 4/4] secret_conf: Modernize XML parsing & formatting

2024-02-13 Thread Michal Privoznik
Our virSecret XML is still parsed and formatted using old way (e.g. virXPathString() + virXXXTypeFromString() combo, or formatting elements using plain virBufferAsprintf() instead of virXMLFormatElement()). Modernize the code as it'll make it easier for future expansion. Signed-off-by: Michal Priv

[PATCH 2/4] secret_conf: Simplify calling of virSecretDefParseUsage()

2024-02-13 Thread Michal Privoznik
The virSecretDefParseUsage() function is called conditionally. Call it unconditionally and keep pointer to the node as it'll come handy soon. Signed-off-by: Michal Privoznik --- src/conf/secret_conf.c | 23 +++ 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/s

[PATCH 3/4] virSecretDef: Convert 'usage_type' field to proper enum type

2024-02-13 Thread Michal Privoznik
Convert the field and adjust the XML parsers to use virXMLPropEnum(). Signed-off-by: Michal Privoznik --- src/access/viraccessdriverpolkit.c | 4 src/conf/secret_conf.c | 24 src/conf/secret_conf.h | 2 +- 3 files changed, 13 insertions(+),

[PATCH 1/4] viraccessdriverpolkit: Add missing vtpm case

2024-02-13 Thread Michal Privoznik
When adding vtpm virSecret usage type (in v5.6.0-rc1~61) we forgot to update polkit access check. This limited user's ability to match secrets in their rules. Add missing case into switch in virAccessDriverPolkitCheckSecret(). Signed-off-by: Michal Privoznik --- src/access/viraccessdriverpolkit.

[PATCH 0/4] secret: Modernize XML parsing and formatting

2024-02-13 Thread Michal Privoznik
Couple of things happening here: 1) add a missing case to our polkit checks 2) modernize XML parsing and formatting, so that the code is prepared for a new feature I'm working on. Michal Prívozník (4): viraccessdriverpolkit: Add missing vtpm case secret_conf: Simplify calling of virSecretDe

Re: [PATCH v2 09/11] api: add virNodeDeviceUpdate()

2024-02-13 Thread Boris Fiuczynski
On 2/9/24 23:13, Jonathon Jongsma wrote: On 2/7/24 7:39 AM, Boris Fiuczynski wrote: This public API is implemented for almost all other objects that have a concept of persistent definition and activatability. Node devices (mdevs) that can be defined and inactive, it will be useful to be able to

[libvirt PATCH v2 3/3] spec: Disable with_userfaultfd_sysctl on Fedora and RHEL-9

2024-02-13 Thread Jiri Denemark
All supported versions of Fedora and RHEL >= 9.0 support /dev/userfaultfd. Signed-off-by: Jiri Denemark --- libvirt.spec.in | 16 1 file changed, 16 insertions(+) diff --git a/libvirt.spec.in b/libvirt.spec.in index 8413e3c19a..6701f7b6e9 100644 --- a/libvirt.spec.in +++ b/libv

[libvirt PATCH v2 1/3] qemu: Add support for /dev/userfaultfd

2024-02-13 Thread Jiri Denemark
/dev/userfaultfd device is preferred over userfaultfd syscall for post-copy migrations. Unless qemu driver is configured to disable mount namespace or to forbid access to /dev/userfaultfd in cgroup_device_acl, we will copy it to the limited /dev filesystem QEMU will have access to and label it appr

[libvirt PATCH v2 2/3] build: Add userfaultfd_sysctl build option

2024-02-13 Thread Jiri Denemark
This option controls whether the sysctl config for enabling unprivileged userfaultfd will be installed. Signed-off-by: Jiri Denemark --- meson.build | 8 meson_options.txt| 1 + src/qemu/meson.build | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/meso

[libvirt PATCH v2 0/3] qemu: Add support for /dev/userfaultfd

2024-02-13 Thread Jiri Denemark
Jiri Denemark (3): qemu: Add support for /dev/userfaultfd build: Add userfaultfd_sysctl build option spec: Disable with_userfaultfd_sysctl on Fedora and RHEL-9 libvirt.spec.in| 16 +++ meson.build| 8 ++ meson_options.txt

Re: [PATCH v2 10/11] nodedev: Implement virNodeDeviceUpdateXML

2024-02-13 Thread Boris Fiuczynski
On 2/9/24 23:45, Jonathon Jongsma wrote: On 2/7/24 7:39 AM, Boris Fiuczynski wrote: Implement the API functions in the node device driver by using mdevctl modify with the options defined and live. Instead of increasing the minimum mdevctl version to 1.3.0 in spec file to ensure support exists in