From: Greg Kroah-Hartman Date: Tue, 17 Jun 2014 23:07:08 +0000 (-0700) Subject: Revert "uio: fix vma io range check in mmap" X-Git-Tag: v3.16-rc2~10^2~2 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=b29f680c4fe305902d02c1d5aa4968fe13a45fe6;p=~emulex%2Finfiniband.git Revert "uio: fix vma io range check in mmap" This reverts commit ddb09754e6c7239e302c7b675df9bbd415f8de5d. Linus objected to this originally, I can see why it might be needed, but given that no one spoke up defending this patch, I'm going to revert it. If you have hardware that requires this change, please speak up in the future and defend the patch. Reported-by: Linus Torvalds Cc: Bin Wang Cc: Nobuhiro Iwamatsu Cc: Norbert Ciosek Cc: stable Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c index e371f5af11f..a673e5b6a2e 100644 --- a/drivers/uio/uio.c +++ b/drivers/uio/uio.c @@ -655,7 +655,7 @@ static int uio_mmap_physical(struct vm_area_struct *vma) if (mem->addr & ~PAGE_MASK) return -ENODEV; - if (vma->vm_end - vma->vm_start > PAGE_ALIGN(mem->size)) + if (vma->vm_end - vma->vm_start > mem->size) return -EINVAL; vma->vm_ops = &uio_physical_vm_ops;