lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fdb5aac8-a657-40ec-9e0b-5340bc144b7b@redhat.com>
Date: Thu, 19 Dec 2024 18:42:09 +0100
From: Paolo Bonzini <pbonzini@...hat.com>
To: Keith Busch <kbusch@...nel.org>
Cc: linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
 michael.christie@...cle.com, Tejun Heo <tj@...nel.org>,
 Luca Boccassi <bluca@...ian.org>
Subject: Re: [PATCH] KVM: x86: switch hugepage recovery thread to vhost_task

On 12/19/24 18:32, Keith Busch wrote:
> This appears to be causing a user space regression. The library
> "minijail" is used by virtual machine manager "crossvm". crossvm uses
> minijail to fork processes, but the library requires the process be
> single threaded. Prior to this patch, the process was single threaded,
> but this change creates a relationship from the kvm thread to the user
> process that fails minijail's test.

Thanks for the report.

The minijail code has a flag that's documented like this:

     /// Disables the check that prevents forking in a multithreaded environment.
     /// This is only safe if the child process calls exec immediately after
     /// forking. The state of locks, and whether or not they will unlock
     /// is undefined. Additionally, objects allocated on other threads that
     /// expect to be dropped when those threads cease execution will not be
     /// dropped.
     /// Thus, nothing should be called that relies on shared synchronization
     /// primitives referenced outside of the current thread. The safest
     /// way to use this is to immediately exec in the child.

Is crosvm trying to do anything but exec?  If not, it should probably use the
flag.

> Fwiw, I think the single threaded check may be misguided, but just doing
> my due diligence to report the user space interaction.

I don't think the check itself is misguided, but if it can be improved to
only look at usermode threads somehow, that would be better.  In general
Linux is moving towards properly tracking the parent-child relationship
of kernel processes (for vhost and io_uring, and now for KVM).

Paolo


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ