app-emulation/qemu: apply patch for vpc creation fix

This commit is contained in:
Nick Owens 2016-11-29 13:18:52 -08:00
parent 420eaab534
commit 899c86cf60
2 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,25 @@
From b737484f814da16b8e9d405219cc1c2e81321d6b Mon Sep 17 00:00:00 2001
From: Nick Owens <mischief@offblast.org>
Date: Mon, 28 Nov 2016 13:28:58 -0800
Subject: [PATCH] block: fix vpc max_table_entries computation
---
block/vpc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/vpc.c b/block/vpc.c
index 43707ed22c..beca222b98 100644
--- a/block/vpc.c
+++ b/block/vpc.c
@@ -787,7 +787,7 @@ static int create_dynamic_disk(BlockBackend *blk, uint8_t *buf,
/* Write the footer (twice: at the beginning and at the end) */
block_size = 0x200000;
- num_bat_entries = (total_sectors + block_size / 512) / (block_size / 512);
+ num_bat_entries = total_sectors / (block_size / 512);
ret = blk_pwrite(blk, offset, buf, HEADER_SIZE, 0);
if (ret < 0) {
--
2.11.0.rc2

View File

@ -364,6 +364,9 @@ src_prepare() {
epatch "${FILESDIR}"/${P}-CVE-2016-9105.patch # bug 598328
epatch "${FILESDIR}"/${P}-CVE-2016-9106.patch # bug 598772
# fix for vpc creation in qemu-img
epatch "${FILESDIR}"/0001-block-fix-vpc-max_table_entries-computation.patch
# Fix ld and objcopy being called directly
tc-export AR LD OBJCOPY