summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Schwebel <r.schwebel@pengutronix.de>2018-03-10 00:05:52 +0100
committerRobert Schwebel <r.schwebel@pengutronix.de>2018-03-10 00:05:52 +0100
commit8a9dc989c2991e969750a500919fceec46e840cd (patch)
tree78568392f83d2c949f92e0015f2331ac79b8b125
parentd25e17545999891b3bae11a539d97bba43f97bb0 (diff)
downloadDistroKit-8a9dc989c2991e969750a500919fceec46e840cd.tar.gz
DistroKit-8a9dc989c2991e969750a500919fceec46e840cd.tar.xz
qemu: add patches from ptxdist-2018.03.0
This is to prepare the addition of another patch. Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
-rw-r--r--patches/qemu-2.10.1/0001-virtfs-proxy-helper-make-sure-sys-xattr.h-is-include.patch37
-rw-r--r--patches/qemu-2.10.1/0002-hw-sd-fix-out-of-bounds-check-for-multi-block-reads.patch50
-rw-r--r--patches/qemu-2.10.1/series5
3 files changed, 92 insertions, 0 deletions
diff --git a/patches/qemu-2.10.1/0001-virtfs-proxy-helper-make-sure-sys-xattr.h-is-include.patch b/patches/qemu-2.10.1/0001-virtfs-proxy-helper-make-sure-sys-xattr.h-is-include.patch
new file mode 100644
index 0000000..809a475
--- /dev/null
+++ b/patches/qemu-2.10.1/0001-virtfs-proxy-helper-make-sure-sys-xattr.h-is-include.patch
@@ -0,0 +1,37 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Tue, 12 Jul 2016 09:20:19 +0200
+Subject: [PATCH] virtfs-proxy-helper: make sure sys/xattr.h is included first
+
+Otherwise building with older glibc versions fails with:
+
+In file included from [...]/include/qemu/xattr.h:26:0,
+ from fsdev/virtfs-proxy-helper.c:26:
+/usr/include/i386-linux-gnu/sys/xattr.h:32:3: error: expected identifier before numeric constant
+make[1]: *** [fsdev/virtfs-proxy-helper.o] Error 1
+make[1]: *** Waiting for unfinished jobs....
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ fsdev/virtfs-proxy-helper.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c
+index 6c066ec9a0ce..dd1801ce8589 100644
+--- a/fsdev/virtfs-proxy-helper.c
++++ b/fsdev/virtfs-proxy-helper.c
+@@ -9,6 +9,7 @@
+ * the COPYING file in the top-level directory.
+ */
+
++#include "qemu/xattr.h"
+ #include "qemu/osdep.h"
+ #include <sys/resource.h>
+ #include <getopt.h>
+@@ -23,7 +24,6 @@
+ #endif
+ #include "qemu-common.h"
+ #include "qemu/sockets.h"
+-#include "qemu/xattr.h"
+ #include "9p-iov-marshal.h"
+ #include "hw/9pfs/9p-proxy.h"
+ #include "fsdev/9p-iov-marshal.h"
diff --git a/patches/qemu-2.10.1/0002-hw-sd-fix-out-of-bounds-check-for-multi-block-reads.patch b/patches/qemu-2.10.1/0002-hw-sd-fix-out-of-bounds-check-for-multi-block-reads.patch
new file mode 100644
index 0000000..d29493d
--- /dev/null
+++ b/patches/qemu-2.10.1/0002-hw-sd-fix-out-of-bounds-check-for-multi-block-reads.patch
@@ -0,0 +1,50 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Fri, 6 Oct 2017 16:46:47 +0100
+Subject: [PATCH] hw/sd: fix out-of-bounds check for multi block reads
+
+The current code checks if the next block exceeds the size of the card.
+This generates an error while reading the last block of the card.
+Do the out-of-bounds check when starting to read a new block to fix this.
+
+This issue became visible with increased error checking in Linux 4.13.
+
+Cc: qemu-stable@nongnu.org
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
+Message-id: 20170916091611.10241-1-m.olbrich@pengutronix.de
+Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
+---
+ hw/sd/sd.c | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/hw/sd/sd.c b/hw/sd/sd.c
+index ba47bff4db80..35347a5bbcde 100644
+--- a/hw/sd/sd.c
++++ b/hw/sd/sd.c
+@@ -1797,8 +1797,13 @@ uint8_t sd_read_data(SDState *sd)
+ break;
+
+ case 18: /* CMD18: READ_MULTIPLE_BLOCK */
+- if (sd->data_offset == 0)
++ if (sd->data_offset == 0) {
++ if (sd->data_start + io_len > sd->size) {
++ sd->card_status |= ADDRESS_ERROR;
++ return 0x00;
++ }
+ BLK_READ_BLOCK(sd->data_start, io_len);
++ }
+ ret = sd->data[sd->data_offset ++];
+
+ if (sd->data_offset >= io_len) {
+@@ -1812,11 +1817,6 @@ uint8_t sd_read_data(SDState *sd)
+ break;
+ }
+ }
+-
+- if (sd->data_start + io_len > sd->size) {
+- sd->card_status |= ADDRESS_ERROR;
+- break;
+- }
+ }
+ break;
+
diff --git a/patches/qemu-2.10.1/series b/patches/qemu-2.10.1/series
new file mode 100644
index 0000000..a7c01fc
--- /dev/null
+++ b/patches/qemu-2.10.1/series
@@ -0,0 +1,5 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-virtfs-proxy-helper-make-sure-sys-xattr.h-is-include.patch
+0002-hw-sd-fix-out-of-bounds-check-for-multi-block-reads.patch
+# a611a3e7e527ebbc7ad1f11615b7ac7d - git-ptx-patches magic