userfaultfd: selftest: add tests for UFFD_FEATURE_SIGBUS feature
authorPrakash Sangappa <prakash.sangappa@oracle.com>
Wed, 6 Sep 2017 23:23:43 +0000 (16:23 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 7 Sep 2017 00:27:29 +0000 (17:27 -0700)
commit81aac3a15ef3e85952daebd199df9c8f1eb24f84
tree8937b2a911ed1142a202b2459b53db3834650898
parent2d6d6f5a09a96cc1fec7ed992b825e05f64cb50e
userfaultfd: selftest: add tests for UFFD_FEATURE_SIGBUS feature

Add tests for UFFD_FEATURE_SIGBUS feature.  The tests will verify signal
delivery instead of userfault events.  Also, test use of UFFDIO_COPY to
allocate memory and retry accessing monitored area after signal
delivery.

Also fix a bug in uffd_poll_thread() where 'uffd' is leaked.

Link: http://lkml.kernel.org/r/1501552446-748335-3-git-send-email-prakash.sangappa@oracle.com
Signed-off-by: Prakash Sangappa <prakash.sangappa@oracle.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
tools/testing/selftests/vm/userfaultfd.c