summaryrefslogtreecommitdiffstats
path: root/hw/s390x/css.c
diff options
context:
space:
mode:
authorPeter Maydell2017-07-28 11:35:02 +0200
committerPeter Maydell2017-07-28 11:35:02 +0200
commit871a0f7ad2b9560c5f7d640125c5be95ca23ca7f (patch)
treef24a3558b915fdae78a9bb322e98fb4be426b710 /hw/s390x/css.c
parentMerge remote-tracking branch 'remotes/kraxel/tags/ui-20170727-pull-request' i... (diff)
parents390x/css: fix bits must be zero check for TIC (diff)
downloadqemu-871a0f7ad2b9560c5f7d640125c5be95ca23ca7f.tar.gz
qemu-871a0f7ad2b9560c5f7d640125c5be95ca23ca7f.tar.xz
qemu-871a0f7ad2b9560c5f7d640125c5be95ca23ca7f.zip
Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20170728' into staging
More s390x fixes: Correct ilen, and ccw checking. # gpg: Signature made Fri 28 Jul 2017 10:13:42 BST # gpg: using RSA key 0xDECF6B93C6F02FAF # gpg: Good signature from "Cornelia Huck <conny@cornelia-huck.de>" # gpg: aka "Cornelia Huck <huckc@linux.vnet.ibm.com>" # gpg: aka "Cornelia Huck <cornelia.huck@de.ibm.com>" # gpg: aka "Cornelia Huck <cohuck@kernel.org>" # Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0 18CE DECF 6B93 C6F0 2FAF * remotes/cohuck/tags/s390x-20170728: s390x/css: fix bits must be zero check for TIC s390x/css: check ccw address validity target/s390x: fix pgm irq ilen in translate_pages() target/s390x: fix pgm irq ilen for stsi Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/s390x/css.c')
-rw-r--r--hw/s390x/css.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/s390x/css.c b/hw/s390x/css.c
index 6a42b95cee..1880b1a0ff 100644
--- a/hw/s390x/css.c
+++ b/hw/s390x/css.c
@@ -795,6 +795,10 @@ static int css_interpret_ccw(SubchDev *sch, hwaddr ccw_addr,
if (!ccw_addr) {
return -EIO;
}
+ /* Check doubleword aligned and 31 or 24 (fmt 0) bit addressable. */
+ if (ccw_addr & (sch->ccw_fmt_1 ? 0x80000007 : 0xff000007)) {
+ return -EINVAL;
+ }
/* Translate everything to format-1 ccws - the information is the same. */
ccw = copy_ccw_from_guest(ccw_addr, sch->ccw_fmt_1);
@@ -881,7 +885,8 @@ static int css_interpret_ccw(SubchDev *sch, hwaddr ccw_addr,
ret = -EINVAL;
break;
}
- if (ccw.flags & (CCW_FLAG_CC | CCW_FLAG_DC)) {
+ if (ccw.flags || ccw.count) {
+ /* We have already sanitized these if converted from fmt 0. */
ret = -EINVAL;
break;
}