Thread (6 messages) 6 messages, 3 authors, 2010-09-12

Re: [PATCH 2/3] S390: Add virtio hotplug add support

From: Heiko Carstens <hidden>
Date: 2010-08-25 08:16:30

On Tue, Aug 24, 2010 at 03:48:51PM +0200, Alexander Graf wrote:
+static void hotplug_devices(struct work_struct *dummy)
+{
+	unsigned int i;
+	struct kvm_device_desc *d;
+	struct device *dev;
+
+	for (i = 0; i < PAGE_SIZE; i += desc_size(d)) {
This should be 

	for (i = 0; i + desc_size(d) <= PAGE_SIZE; i += desc_size(d)) {

otherwise you might have memory accesses beyond the device page...
+		d = kvm_devices + i;
+
+		/* end of list */
+		if (d->type == 0)
+			break;
...even if that should not happen if everything works.
But let's be paranoid.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help