selftests: prctl: Add new prctl test for PR_SET_VMA action
authorIvan Orlov <ivan.orlov0322@gmail.com>
Sat, 25 Mar 2023 20:59:02 +0000 (00:59 +0400)
committerShuah Khan <skhan@linuxfoundation.org>
Tue, 28 Mar 2023 16:28:33 +0000 (10:28 -0600)
commit5290586186d24d81d7f8eee4ba837f0cbc304b09
treedbc06c973701400df5deef669d764a062005760a
parent14f4cc631afdb3234facf8542ea094ec529a4024
selftests: prctl: Add new prctl test for PR_SET_VMA action

This patch will add the new test, which covers the prctl call with
PR_SET_VMA command. The test tries to give a name to the anonymous
VMA within the process memory map, and then checks the result of
the operation by parsing 'maps' virtual file.

Additionally, the test tries to call the prctl PR_SET_VMA command
with invalid arguments, and checks the error codes for correctness.

At the moment anonymous VMA naming through prctl call functionality
is not covered with any tests, so I think implementing it makes sense.

In version 2 of this patch I consider the selftest Makefile rule about
TARGETS entries order - I moved the 'prctl' entry in the Makefile to
follow the lexicographic order. In version 1 it was placed at the
end of the list.

Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/Makefile
tools/testing/selftests/prctl/.gitignore
tools/testing/selftests/prctl/Makefile
tools/testing/selftests/prctl/config [new file with mode: 0644]
tools/testing/selftests/prctl/set-anon-vma-name-test.c [new file with mode: 0644]