From: Jeff Cody <jcody@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, pbonzini@redhat.com, armbru@redhat.com,
stefanha@redhat.com
Subject: [Qemu-devel] [PATCH 1/2] block: vhdx - add error check
Date: Wed, 6 Aug 2014 15:54:57 -0400 [thread overview]
Message-ID: <9c38d02efb0c96e01e1edc6b80ba99f014d5e908.1407353952.git.jcody@redhat.com> (raw)
In-Reply-To: <cover.1407353952.git.jcody@redhat.com>
In-Reply-To: <cover.1407353952.git.jcody@redhat.com>
This add an error check for an invalid descriptor entry signature,
when flushing the log descriptor entries.
Signed-off-by: Jeff Cody <jcody@redhat.com>
---
block/vhdx-log.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/block/vhdx-log.c b/block/vhdx-log.c
index a77c040..7c2630d 100644
--- a/block/vhdx-log.c
+++ b/block/vhdx-log.c
@@ -435,6 +435,11 @@ static int vhdx_log_flush_desc(BlockDriverState *bs, VHDXLogDescriptor *desc,
/* write 'count' sectors of sector */
memset(buffer, 0, VHDX_LOG_SECTOR_SIZE);
count = desc->zero_length / VHDX_LOG_SECTOR_SIZE;
+ } else {
+ error_report("Invalid VHDX log descriptor entry signature 0x%" PRIx32,
+ desc->signature);
+ ret = -EINVAL;
+ goto exit;
}
file_offset = desc->file_offset;
--
1.9.3
next prev parent reply other threads:[~2014-08-06 19:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-06 19:54 [Qemu-devel] [PATCH 0/2] VHDX endian fixes, error reporting Jeff Cody
2014-08-06 19:54 ` Jeff Cody [this message]
2014-08-06 19:54 ` [Qemu-devel] [PATCH 2/2] block: VHDX endian fixes Jeff Cody
2014-08-07 10:05 ` [Qemu-devel] [PATCH 0/2] VHDX endian fixes, error reporting Stefan Hajnoczi
2014-08-07 14:07 ` Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9c38d02efb0c96e01e1edc6b80ba99f014d5e908.1407353952.git.jcody@redhat.com \
--to=jcody@redhat.com \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).