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: <91c76eb0edcd4f1a9d5bc541d35f8ade@AcuMS.aculab.com>
Date:   Wed, 29 Apr 2020 08:56:12 +0000
From:   David Laight <David.Laight@...LAB.COM>
To:     'Jim Mattson' <jmattson@...gle.com>,
        'Paolo Bonzini' <pbonzini@...hat.com>
CC:     'LKML' <linux-kernel@...r.kernel.org>,
        'kvm list' <kvm@...r.kernel.org>,
        'Sean Christopherson' <sean.j.christopherson@...el.com>,
        'Joerg Roedel' <joro@...tes.org>,
        "'everdox@...il.com'" <everdox@...il.com>
Subject: RE: [PATCH] KVM: x86: handle wrap around 32-bit address space

From: David Laight
> Sent: 29 April 2020 09:50
> From: Jim Mattson
> > Sent: 28 April 2020 01:29
> > On Mon, Apr 27, 2020 at 9:59 AM Paolo Bonzini <pbonzini@...hat.com> wrote:
> > >
> > > KVM is not handling the case where EIP wraps around the 32-bit address
> > > space (that is, outside long mode).  This is needed both in vmx.c
> > > and in emulate.c.  SVM with NRIPS is okay, but it can still print
> > > an error to dmesg due to integer overflow.
> ...
> > > +               if (unlikely(((rip ^ orig_rip) >> 31) == 3) && !is_64_bit_mode(vcpu))
> 
> Isn't the more obvious:
> 	if (((rip ^ orig_rip) & 1ull << 32) ...
> equivalent?

Actually not even being clever, how about:
	if (orig_rip < (1ull << 32) && unlikely(rip >= (1ull << 32)) && ...

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ