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-next>] [day] [month] [year] [list]
Message-Id: <1496064244-14785-1-git-send-email-gi-oh.kim@profitbricks.com>
Date:   Mon, 29 May 2017 15:24:04 +0200
From:   Gioh Kim <gi-oh.kim@...fitbricks.com>
To:     andre.przywara@....com, kvm@...r.kernel.org
Cc:     linux-kernel@...r.kernel.org, Gioh Kim <gi-oh.kim@...fitbricks.com>
Subject: [RFC] KVM: SVM: ignore type when setting segment registers

Current code sets unusable as 1 if present is 1 and type is 0.
In Long mode, type value in segment descriptor is ignored.
So I think type should be ignored when setting the segment registers,
if type means the descriptor type in the segment descriptor.

Is the type field of struct kvm_segment the descriptor type?
If so, why type is checked when setting segment registers?

If the type field is not the descriptor type,
is it ok to set unusable when present is 1?

I'm copying a code as following to show what code I'm asking.

----------------------------- 8< ---------------------------------
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 5f48f62..0133f6f 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -1803,7 +1803,7 @@ static void svm_get_segment(struct kvm_vcpu *vcpu,
 	 * AMD's VMCB does not have an explicit unusable field, so emulate it
 	 * for cross vendor migration purposes by "not present"
 	 */
-	var->unusable = !var->present || (var->type == 0);
+	var->unusable = !var->present;
 
 	switch (seg) {
 	case VCPU_SREG_TR:
-- 
2.5.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ