]> git.baikalelectronics.ru Git - kernel.git/commit
uio: fix vma io range check in mmap
authorBin Wang <binw@marvell.com>
Tue, 25 Mar 2014 05:52:06 +0000 (13:52 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 May 2014 21:11:06 +0000 (14:11 -0700)
commitc3047436833483a5a927899e7ab0a2dfd4a8a9b3
treeb8bb721fe4a516240583e740c33d751df2eb28c6
parent44773ce4e7f3842c6451f30202e39af97c578e58
uio: fix vma io range check in mmap

the vma range size is always page size aligned in mmap, while the
real io space range may not be page aligned, thus leading to range
check failure in the uio_mmap_physical().

for example, in a case of io range size "mem->size == 1KB", and we
have (vma->vm_end - vma->vm_start) == 4KB, due to "len" is aligned
to page size in do_mmap_pgoff().

now fix this issue by align mem->size to page size in the check.

Signed-off-by: Bin Wang <binw@marvell.com>
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/uio/uio.c