]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu_passt: Precreate passt logfile
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 9 Jun 2023 06:59:18 +0000 (08:59 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 26 Jun 2023 13:52:54 +0000 (15:52 +0200)
commit8511b96a319836700b4829816cdae27c3630060d
treed298f0975d30437d5e3f78d5555a008bd5424636
parentf4fea84f59b5e6b103cf9b8918a003e5081c1af8
qemu_passt: Precreate passt logfile

There are a few situations where passt itself is unable to create
a file because it runs under QEMU user (e.g. just like our
example from formatdomain.rst suggests: /var/log/passt.log). If
libvirtd runs with sufficient permissions (e.g. as root) it can
create the file and set seclabels on it so that passt can then
open it.

Ideally, we would just pass pre-opened FD, but this wasn't viewed
as secure enough [1]. So lets just create the file and set
seclabels.

For the case when both libvirtd and passt have the same
permissions, well then we fail before even needing to fork() and
exec().

1: https://archives.passt.top/passt-dev/20230606225836.63aecebe@elisabeth/
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2209191
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_passt.c