test_user_copy: Test partially invalid copies

Test copy_from_user() and copy_to_user() more exhaustively, particularly
around failure behaviour when mappings are partially invalid (both when
they start valid and when they start invalid).

This is done by allocating 4 user pages instead of 2, and unmapping the
first and last page to provide known invalid mappings on either side of
the known good user pages.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: linux-kernel@vger.kernel.org
Cc: Kees Cook <keescook@chromium.org>
1 file changed