From 8a9dc989c2991e969750a500919fceec46e840cd Mon Sep 17 00:00:00 2001 From: Robert Schwebel Date: Sat, 10 Mar 2018 00:05:52 +0100 Subject: qemu: add patches from ptxdist-2018.03.0 This is to prepare the addition of another patch. Signed-off-by: Robert Schwebel --- ...y-helper-make-sure-sys-xattr.h-is-include.patch | 37 ++++++++++++++++ ...out-of-bounds-check-for-multi-block-reads.patch | 50 ++++++++++++++++++++++ patches/qemu-2.10.1/series | 5 +++ 3 files changed, 92 insertions(+) create mode 100644 patches/qemu-2.10.1/0001-virtfs-proxy-helper-make-sure-sys-xattr.h-is-include.patch create mode 100644 patches/qemu-2.10.1/0002-hw-sd-fix-out-of-bounds-check-for-multi-block-reads.patch create mode 100644 patches/qemu-2.10.1/series 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 +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 +--- + 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 + #include +@@ -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 +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 +Reviewed-by: Alistair Francis +Message-id: 20170916091611.10241-1-m.olbrich@pengutronix.de +Signed-off-by: Peter Maydell +--- + 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 -- cgit v1.2.3