Blame SOURCES/kvm-block-vhdx-add-error-check.patch

d81766
From fe7fa3390a380edff11e85cf9a6fe979f99096b7 Mon Sep 17 00:00:00 2001
d81766
From: Jeffrey Cody <jcody@redhat.com>
d81766
Date: Tue, 19 Aug 2014 18:16:47 +0200
d81766
Subject: [PATCH 02/32] block: vhdx - add error check
d81766
d81766
Message-id: <124fe1958f92a285960c59f7bcea5378eee149a5.1408471833.git.jcody@redhat.com>
d81766
Patchwork-id: 60628
d81766
O-Subject: [PATCH qemu-kvm-rhev RHEV7.1 1/2] block: vhdx - add error check
d81766
Bugzilla: 1126976
d81766
RH-Acked-by: dgibson <dgibson@redhat.com>
d81766
RH-Acked-by: Markus Armbruster <armbru@redhat.com>
d81766
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
d81766
d81766
This add an error check for an invalid descriptor entry signature,
d81766
when flushing the log descriptor entries.
d81766
d81766
Signed-off-by: Jeff Cody <jcody@redhat.com>
d81766
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
d81766
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
d81766
(cherry picked from commit 349592e0b9112171500e940dd921bb96cfc496d2)
d81766
---
d81766
 block/vhdx-log.c | 5 +++++
d81766
 1 file changed, 5 insertions(+)
d81766
d81766
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
d81766
---
d81766
 block/vhdx-log.c | 5 +++++
d81766
 1 file changed, 5 insertions(+)
d81766
d81766
diff --git a/block/vhdx-log.c b/block/vhdx-log.c
d81766
index a77c040..7c2630d 100644
d81766
--- a/block/vhdx-log.c
d81766
+++ b/block/vhdx-log.c
d81766
@@ -435,6 +435,11 @@ static int vhdx_log_flush_desc(BlockDriverState *bs, VHDXLogDescriptor *desc,
d81766
         /* write 'count' sectors of sector */
d81766
         memset(buffer, 0, VHDX_LOG_SECTOR_SIZE);
d81766
         count = desc->zero_length / VHDX_LOG_SECTOR_SIZE;
d81766
+    } else {
d81766
+        error_report("Invalid VHDX log descriptor entry signature 0x%" PRIx32,
d81766
+                      desc->signature);
d81766
+        ret = -EINVAL;
d81766
+        goto exit;
d81766
     }
d81766
 
d81766
     file_offset = desc->file_offset;
d81766
-- 
d81766
1.8.3.1
d81766