xen/xenbus: Reject replies with payload > XENSTORE_PAYLOAD_MAX.
[pandora-kernel.git] / drivers / xen / xenbus / xenbus_xs.c
index ede860f..a580b17 100644 (file)
@@ -801,6 +801,12 @@ static int process_msg(void)
                goto out;
        }
 
+       if (msg->hdr.len > XENSTORE_PAYLOAD_MAX) {
+               kfree(msg);
+               err = -EINVAL;
+               goto out;
+       }
+
        body = kmalloc(msg->hdr.len + 1, GFP_NOIO | __GFP_HIGH);
        if (body == NULL) {
                kfree(msg);