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>] [day] [month] [year] [list]
Message-ID: <20080721145826.GA14846@cs181140183.pp.htv.fi>
Date:	Mon, 21 Jul 2008 17:58:26 +0300
From:	Adrian Bunk <adrian.bunk@...ial.fi>
To:	Tan Li <li.tan@...el.com>, Jerone Young <jyoung5@...ibm.com>,
	Hollis Blanchard <hollisb@...ibm.com>,
	Avi Kivity <avi@...ranet.com>
Cc:	kvm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [2.6 patch] KVM: fix userspace ABI breakage

The following part of commit 9ef621d3be56e1188300476a8102ff54f7b6793f 
(KVM: Support mixed endian machines) changed on the size of a struct 
that is exported to userspace:

include/linux/kvm.h:

@@ -318,14 +318,14 @@ struct kvm_trace_rec {
 	__u32 vcpu_id;
 	union {
 		struct {
-			__u32 cycle_lo, cycle_hi;
+			__u64 cycle_u64;
 			__u32 extra_u32[KVM_TRC_EXTRA_MAX];
 		} cycle;
 		struct {
 			__u32 extra_u32[KVM_TRC_EXTRA_MAX];
 		} nocycle;
 	} u;
-};
+} __attribute__((packed));
 

Packing a struct was the correct idea, but it packed the wrong struct.

Signed-off-by: Adrian Bunk <adrian.bunk@...ial.fi>

---
857d4ddbb62bc61e44b8870cda8ea1c38c6e1905 
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 0ea064c..ad11cfe 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -320,12 +320,12 @@ struct kvm_trace_rec {
 		struct {
 			__u64 cycle_u64;
 			__u32 extra_u32[KVM_TRC_EXTRA_MAX];
-		} cycle;
+		} __attribute__((packed)) cycle;
 		struct {
 			__u32 extra_u32[KVM_TRC_EXTRA_MAX];
 		} nocycle;
 	} u;
-} __attribute__((packed));
+};
 
 #define KVMIO 0xAE
 

--
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