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]
Message-ID: <469C7A05.2070205@qumranet.com>
Date:	Tue, 17 Jul 2007 11:12:53 +0300
From:	Avi Kivity <avi@...ranet.com>
To:	Jeff Dike <jdike@...toit.com>
CC:	LKML <linux-kernel@...r.kernel.org>,
	KVM devel <kvm-devel@...ts.sourceforge.net>
Subject: Re: [PATCH 1/3] KVM - Add missing kvm_run initializations

Jeff Dike wrote:
> There are a bunch of missing initializations of run->exit_reason and
> associated data.
>
> kvm_hypercall wasn't setting exit_reason at all.
>
> When exit_reason is KVM_EXIT_MMIO, the mmio data isn't initialized.  I
> don't know what it should be, so I just stuck a FIXME in there.
>
> There were some missing initializations of hardware_exit_reason with
> KVM_EXIT_UNKNOWN, so I added those.  One case had exit_reason = 0,
> which I changed to KVM_EXIT_UNKNOWN.
>
> I did a pass over all of the return 0 paths in the exit handler
> callbacks, so this should cover everything.
>
> Signed-off-by: Jeff Dike <jdike@...ux.intel.com>
> --
>  drivers/kvm/kvm_main.c |    3 +++
>  drivers/kvm/svm.c      |    3 +++
>  drivers/kvm/vmx.c      |    4 +++-
>  3 files changed, 9 insertions(+), 1 deletion(-)
>
> Index: kvm/drivers/kvm/kvm_main.c
> ===================================================================
> --- kvm.orig/drivers/kvm/kvm_main.c
> +++ kvm/drivers/kvm/kvm_main.c
> @@ -1370,6 +1370,7 @@ int kvm_hypercall(struct kvm_vcpu *vcpu,
>  		run->hypercall.ret = ret;
>  		run->hypercall.longmode = is_long_mode(vcpu);
>  		kvm_arch_ops->decache_regs(vcpu);
> +		run->exit_reason = KVM_EXIT_HYPERCALL;
>  		return 0;
>  	}
>   

Aye. (And: aiiieee)

>  	vcpu->regs[VCPU_REGS_RAX] = ret;
> @@ -1928,6 +1929,8 @@ static int kvm_vcpu_ioctl_run(struct kvm
>  		if (r == EMULATE_DO_MMIO) {
>  			/*
>  			 * Read-modify-write.  Back to userspace.
> +			 *
> +			 * FIXME - kvm_run->mmio not initialized
>  			 */
>  			kvm_run->exit_reason = KVM_EXIT_MMIO;
>  			r = 0;
>   

I believe that emulate_instruction will set run->mmio if it returns 
EMULATE_DO_MMIO.

> Index: kvm/drivers/kvm/svm.c
> ===================================================================
> --- kvm.orig/drivers/kvm/svm.c
> +++ kvm/drivers/kvm/svm.c
> @@ -929,6 +929,7 @@ static int pf_interception(struct kvm_vc
>  		return 1;
>  	case EMULATE_DO_MMIO:
>  		++vcpu->stat.mmio_exits;
> +		/* FIXME - kvm_run->mmio not initialized */
>  		kvm_run->exit_reason = KVM_EXIT_MMIO;
>   

Ditto.

The rest are all good.

-- 
error compiling committee.c: too many arguments to function

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ