]> git.ipfire.org Git - people/ms/linux.git/commitdiff
vhost: relax log address alignment
authorMichael S. Tsirkin <mst@redhat.com>
Mon, 16 Nov 2015 14:57:08 +0000 (16:57 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 7 Dec 2015 15:27:54 +0000 (17:27 +0200)
commit 5d9a07b0de512b77bf28d2401e5fe3351f00a240 ("vhost: relax used
address alignment") fixed the alignment for the used virtual address,
but not for the physical address used for logging.

That's a mistake: alignment should clearly be the same for virtual and
physical addresses,

Cc: stable@vger.kernel.org
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/vhost/vhost.c

index eec2f11809ff2463d2a714224925af9c679fead1..080422f5464fe60524fa1f9947be0d6893581349 100644 (file)
@@ -819,7 +819,7 @@ long vhost_vring_ioctl(struct vhost_dev *d, int ioctl, void __user *argp)
                BUILD_BUG_ON(__alignof__ *vq->used > VRING_USED_ALIGN_SIZE);
                if ((a.avail_user_addr & (VRING_AVAIL_ALIGN_SIZE - 1)) ||
                    (a.used_user_addr & (VRING_USED_ALIGN_SIZE - 1)) ||
-                   (a.log_guest_addr & (sizeof(u64) - 1))) {
+                   (a.log_guest_addr & (VRING_USED_ALIGN_SIZE - 1))) {
                        r = -EINVAL;
                        break;
                }