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: <20220207154707.GC526451@lothringen>
Date:   Mon, 7 Feb 2022 16:47:07 +0100
From:   Frederic Weisbecker <frederic@...nel.org>
To:     Marcelo Tosatti <mtosatti@...hat.com>
Cc:     linux-kernel@...r.kernel.org, Nitesh Lal <nilal@...hat.com>,
        Nicolas Saenz Julienne <nsaenzju@...hat.com>,
        Christoph Lameter <cl@...ux.com>,
        Juri Lelli <juri.lelli@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Alex Belits <abelits@...its.com>, Peter Xu <peterx@...hat.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Daniel Bristot de Oliveira <bristot@...hat.com>,
        Oscar Shiang <oscar0225@...email.tw>
Subject: Re: [patch v11 10/13] KVM: x86: process isolation work from VM-entry
 code path

On Fri, Feb 04, 2022 at 02:35:47PM -0300, Marcelo Tosatti wrote:
> VM-entry code path is an entry point similar to userspace return
> when task isolation is concerned.
> 
> Call isolation_exit_to_user_mode before VM-enter.
> 
> Signed-off-by: Marcelo Tosatti <mtosatti@...hat.com>
> 
> ---
> v11
> - Add TIF_TASK_ISOL bit to thread info flags and use it
>   to decide whether to perform task isolation work on
>   return to userspace                                   (Frederic W. Weisbecker)
> 
>  include/linux/entry-kvm.h |    4 +++-
>  kernel/entry/kvm.c        |   18 ++++++++++++++----
>  2 files changed, 17 insertions(+), 5 deletions(-)
> 
> Index: linux-2.6/kernel/entry/kvm.c
> ===================================================================
> --- linux-2.6.orig/kernel/entry/kvm.c
> +++ linux-2.6/kernel/entry/kvm.c
> @@ -2,6 +2,7 @@
>  
>  #include <linux/entry-kvm.h>
>  #include <linux/kvm_host.h>
> +#include <linux/task_isolation.h>
>  
>  static int xfer_to_guest_mode_work(struct kvm_vcpu *vcpu, unsigned long ti_work)
>  {
> @@ -22,6 +23,9 @@ static int xfer_to_guest_mode_work(struc
>  		if (ti_work & _TIF_NOTIFY_RESUME)
>  			tracehook_notify_resume(NULL);
>  
> +		if (ti_work & _TIF_TASK_ISOL)
> +			task_isol_exit_to_user_mode();
> +
>  		ret = arch_xfer_to_guest_mode_handle_work(vcpu, ti_work);
>  		if (ret)
>  			return ret;
> 
> 

Do you need this?

diff --git a/include/linux/entry-kvm.h b/include/linux/entry-kvm.h
index 07c878d6e323..3588d6071caf 100644
--- a/include/linux/entry-kvm.h
+++ b/include/linux/entry-kvm.h
@@ -18,7 +18,7 @@
 
 #define XFER_TO_GUEST_MODE_WORK						\
 	(_TIF_NEED_RESCHED | _TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL |	\
-	 _TIF_NOTIFY_RESUME | ARCH_XFER_TO_GUEST_MODE_WORK)
+	 _TIF_NOTIFY_RESUME | _TIF_TASK_ISOL | ARCH_XFER_TO_GUEST_MODE_WORK)
 
 struct kvm_vcpu;
 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ