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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 08 Feb 2022 16:34:53 +0200
From:   Maxim Levitsky <mlevitsk@...hat.com>
To:     Sean Christopherson <seanjc@...gle.com>
Cc:     kvm@...r.kernel.org, Kieran Bingham <kbingham@...nel.org>,
        Jan Kiszka <jan.kiszka@...mens.com>,
        Andrew Jones <drjones@...hat.com>,
        Jonathan Corbet <corbet@....net>,
        Vitaly Kuznetsov <vkuznets@...hat.com>,
        Ingo Molnar <mingo@...hat.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@...nel.org>,
        Johannes Berg <johannes.berg@...el.com>,
        Wanpeng Li <wanpengli@...cent.com>,
        "H. Peter Anvin" <hpa@...or.com>, Jessica Yu <jeyu@...nel.org>,
        Jim Mattson <jmattson@...gle.com>,
        Paolo Bonzini <pbonzini@...hat.com>,
        Joerg Roedel <joro@...tes.org>,
        Yang Weijiang <weijiang.yang@...el.com>,
        linux-kernel@...r.kernel.org, Borislav Petkov <bp@...en8.de>,
        "open list:KERNEL SELFTEST FRAMEWORK" 
        <linux-kselftest@...r.kernel.org>,
        "open list:DOCUMENTATION" <linux-doc@...r.kernel.org>,
        Shuah Khan <shuah@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Borislav Petkov <bp@...e.de>
Subject: Re: [PATCH v3 2/6] KVM: x86: add force_intercept_exceptions_mask

On Thu, 2021-09-02 at 16:56 +0000, Sean Christopherson wrote:
> Assuming this hasn't been abandoned...
> 
> On Wed, Aug 11, 2021, Maxim Levitsky wrote:
> > This parameter will be used by VMX and SVM code to force
> > interception of a set of exceptions, given by a bitmask
> > for guest debug and/or kvm debug.
> > 
> > This is based on an idea first shown here:
> > https://patchwork.kernel.org/project/kvm/patch/20160301192822.GD22677@pd.tnic/
> > 
> > CC: Borislav Petkov <bp@...e.de>
> > Signed-off-by: Maxim Levitsky <mlevitsk@...hat.com>
> > ---
> >  arch/x86/kvm/x86.c | 3 +++
> >  arch/x86/kvm/x86.h | 2 ++
> >  2 files changed, 5 insertions(+)
> > 
> > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> > index fdc0c18339fb..092e2fad3c0d 100644
> > --- a/arch/x86/kvm/x86.c
> > +++ b/arch/x86/kvm/x86.c
> > @@ -184,6 +184,9 @@ module_param(force_emulation_prefix, bool, S_IRUGO);
> >  int __read_mostly pi_inject_timer = -1;
> >  module_param(pi_inject_timer, bint, S_IRUGO | S_IWUSR);
> >  
> > +uint force_intercept_exceptions_mask;
> > +module_param(force_intercept_exceptions_mask, uint, S_IRUGO | S_IWUSR);
> 
> Use octal permissions.  This also can't be a simple writable param, at least not
> without a well-documented disclaimer, as there's no guarantee a vCPU will update
> its exception bitmap in a timely fashion.  An alternative to a module param would
> be to extend/add a per-VM ioctl(), e.g. maybe KVM_SET_GUEST_DEBUG?  The downside
> of an ioctl() is that it would require userspace enabling :-/
> 

All other module params in this file use macros for permissions, that is why
I used them too.

I'll add a comment with a disclaimer here - this is only for debug.
I strongly don't want to have this as ioctl as that will indeed need qemu patches,
not to mention things like unit tests and which don't even always use qemu.

Or I can make this parameter read-only. I don't mind reloading kvm module when
I change this parameter.


Best regards,
	Maxim Levitsky

PS: Forgot to send this mail, it was in my drafts folder.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ