|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] [PATCH 10 of 12] backport fbb7b4e0804d2168f24142eebf7552adde
Backport fbb7b4e0804d2168f24142eebf7552adde1968dc from qemu upstream:
Improve block range checks
---
diff -r a9605b2f542b block.c
--- a/block.c Fri Oct 02 13:41:55 2009 +0100
+++ b/block.c Fri Oct 02 14:41:51 2009 +0100
@@ -559,7 +559,10 @@
len = bdrv_getlength(bs);
- if ((offset + size) > len)
+ if (offset < 0)
+ return -EIO;
+
+ if ((offset > len) || (len - offset < size))
return -EIO;
return 0;
@@ -1209,6 +1212,8 @@
return -EIO;
if (!drv->bdrv_write_compressed)
return -ENOTSUP;
+ if (bdrv_check_request(bs, sector_num, nb_sectors))
+ return -EIO;
return drv->bdrv_write_compressed(bs, sector_num, buf, nb_sectors);
}
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
<Prev in Thread] |
Current Thread |
[Next in Thread> |
- [Xen-devel] [PATCH 10 of 12] backport fbb7b4e0804d2168f24142eebf7552adde1968dc,
Stefano Stabellini <=
|
|
|
|
|