vmbus: initialize reserved fields in messages
authorStephen Hemminger <stephen@networkplumber.org>
Fri, 6 Oct 2017 00:35:05 +0000 (17:35 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Oct 2017 13:27:24 +0000 (15:27 +0200)
Make sure and initialize reserved fields in messages to host,
rather than passing stack junk.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hv/channel.c

index 894b67ac2cae509296cc6c421565df9b7ec48f7f..a406beb10dd055e98fa831a599b0180a4e70b2ba 100644 (file)
@@ -745,6 +745,7 @@ int vmbus_sendpacket_pagebuffer(struct vmbus_channel *channel,
        desc.dataoffset8 = descsize >> 3; /* in 8-bytes granularity */
        desc.length8 = (u16)(packetlen_aligned >> 3);
        desc.transactionid = requestid;
+       desc.reserved = 0;
        desc.rangecount = pagecount;
 
        for (i = 0; i < pagecount; i++) {
@@ -788,6 +789,7 @@ int vmbus_sendpacket_mpb_desc(struct vmbus_channel *channel,
        desc->dataoffset8 = desc_size >> 3; /* in 8-bytes granularity */
        desc->length8 = (u16)(packetlen_aligned >> 3);
        desc->transactionid = requestid;
+       desc->reserved = 0;
        desc->rangecount = 1;
 
        bufferlist[0].iov_base = desc;