Skip to contentSkip to conversation

Drivers: hv: vmbus: Initialize request offers message for Isolation VM

PATCH Applied Juan Vazquez 2 participants 2 messages Jan 5, 2022

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

PATCH 1/1 Drivers: hv: vmbus: Initialize request offers message for Isolation VM

Initialize memory of request offers message to be sent to the host so padding or uninitialized fields do not leak guest memory contents.

---
 drivers/hv/channel_mgmt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hv/channel_mgmt.c +1 -1
index 2829575fd9b7..60375879612f 100644
@@ -1554,7 +1554,7 @@ int vmbus_request_offers(void)
 	struct vmbus_channel_msginfo *msginfo;
 	int ret;
 
-	msginfo = kmalloc(sizeof(*msginfo) +
+	msginfo = kzalloc(sizeof(*msginfo) +
 			  sizeof(struct vmbus_channel_message_header),
 			  GFP_KERNEL);
 	if (!msginfo)
Signature · 1 line
2.32.0
maintainer Applied
#1 lore raw
Quoted 4 lines · Juan Vazquez

Initialize memory of request offers message to be sent to the host so padding or uninitialized fields do not leak guest memory contents.

Applied to hyperv-next. Thanks.

Quoted 20 lines
---
 drivers/hv/channel_mgmt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hv/channel_mgmt.c +1 -1
index 2829575fd9b7..60375879612f 100644
@@ -1554,7 +1554,7 @@ int vmbus_request_offers(void)
 	struct vmbus_channel_msginfo *msginfo;
 	int ret;
 
-	msginfo = kmalloc(sizeof(*msginfo) +
+	msginfo = kzalloc(sizeof(*msginfo) +
 			  sizeof(struct vmbus_channel_message_header),
 			  GFP_KERNEL);
 	if (!msginfo)
Signature · 1 line
2.32.0