]> git.baikalelectronics.ru Git - kernel.git/commit
UIO: Take offset into account when determining number of pages that can be mapped
authorIan Abbott <abbotti@mev.co.uk>
Tue, 24 Feb 2009 17:22:59 +0000 (17:22 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 24 Mar 2009 23:38:25 +0000 (16:38 -0700)
commit33daf09bb848c698bc15fc8bb7f5ea02dd29ba89
tree46bdf19836227b27c4548431ec7cea5eeb2a8a08
parentc7428c2479b798d944397e2afaf0a4fe0ed6cc36
UIO: Take offset into account when determining number of pages that can be mapped

If a UIO memory region does not start on a page boundary but straddles one,
the number of actual pages that overlap the memory region may be calculated
incorrectly because the offset isn't taken into account.  If userspace sets
the mmap length to offset+size, it may fail with -EINVAL if UIO thinks it's
trying to allocate too many pages.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Cc: Hans J. Koch <hjk@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/uio/uio.c