Skip to contentSkip to conversation

Drivers: hv: Explicitly size elements of protocol structures

PATCH In review K. Y. Srinivasan 2 participants 3 messages Aug 16, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Drivers: hv: Explicitly size elements of protocol structures

Use explicitly sized types in data structures defining the host/guest protocol. I would like to thank Juan Sanchez-Agrelo <[email protected]> for reporting this.

---
 include/linux/hyperv.h |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
include/linux/hyperv.h +4 -4
index 588d8f2..e73b852 100644
@@ -489,7 +489,7 @@ struct vmtransfer_page_range {
 struct vmtransfer_page_packet_header {
 	struct vmpacket_descriptor d;
 	u16 xfer_pageset_id;
-	bool sender_owns_set;
+	u8  sender_owns_set;
 	u8 reserved;
 	u32 range_cnt;
 	struct vmtransfer_page_range ranges[1];
@@ -643,7 +643,7 @@ struct vmbus_channel_query_vmbus_version {
 /* VMBus Version Supported parameters */
 struct vmbus_channel_version_supported {
 	struct vmbus_channel_message_header header;
-	bool version_supported;
+	u8 version_supported;
 } __packed;
 
 /* Offer Channel parameters */
@@ -652,7 +652,7 @@ struct vmbus_channel_offer_channel {
 	struct vmbus_channel_offer offer;
 	u32 child_relid;
 	u8 monitorid;
-	bool monitor_allocated;
+	u8 monitor_allocated;
 } __packed;
 
 /* Rescind Offer parameters */
@@ -788,7 +788,7 @@ struct vmbus_channel_initiate_contact {
 
 struct vmbus_channel_version_response {
 	struct vmbus_channel_message_header header;
-	bool version_supported;
+	u8 version_supported;
 } __packed;
 
 enum vmbus_channel_state {
Signature · 1 line
1.7.4.1
#1 lore raw
Quoted 6 lines · K. Y. Srinivasan

Use explicitly sized types in data structures defining the host/guest protocol. I would like to thank Juan Sanchez-Agrelo <[email protected]> for reporting this.

If someone reports a problem, mark it as:

in the signed-off-by: area of the patch.

Does this need to go into 3.6, and possibly older kernels? Or can it wait for 3.7?

thanks,

greg k-h

#2 lore raw
Quoted 17 lines

-----Original Message-----
From: Greg KH [mailto:[email protected]]
Sent: Thursday, August 16, 2012 3:36 PM
To: KY Srinivasan
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 1/1] Drivers: hv: Explicitly size elements of protocol structures

Quoted 4 lines · K. Y. Srinivasan

Use explicitly sized types in data structures defining the host/guest protocol. I would like to thank Juan Sanchez-Agrelo <[email protected]> for reporting this.

Quoted 6 lines
Quoted 2 lines

If someone reports a problem, mark it as:

in the signed-off-by: area of the patch.

Will do.

Quoted 3 lines

Does this need to go into 3.6, and possibly older kernels? Or can it wait for 3.7?

Given the "stable kernel rules", I don't think this needs to go into older kernels. This can wait for 3.7.

Thanks,

K. Y