aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Analysis/ValueTrackingTest.cpp
diff options
context:
space:
mode:
authorMatthew Malcomson <matthew.malcomson@arm.com>2021-01-13 11:35:09 +0000
committerMatthew Malcomson <matthew.malcomson@arm.com>2021-01-13 11:35:09 +0000
commit1854594b80b444dc21b830b51e53e05d38fc7d60 (patch)
tree575327d10b48feaf0c1c485105479d79155fbd79 /llvm/unittests/Analysis/ValueTrackingTest.cpp
parentad85e3967067154a579f7989ce0e736f8cd56be9 (diff)
downloadllvm-1854594b80b444dc21b830b51e53e05d38fc7d60.zip
llvm-1854594b80b444dc21b830b51e53e05d38fc7d60.tar.gz
llvm-1854594b80b444dc21b830b51e53e05d38fc7d60.tar.bz2
Hwasan InitPrctl check for error using internal_iserror
When adding this function in https://reviews.llvm.org/D68794 I did not notice that internal_prctl has the API of the syscall to prctl rather than the API of the glibc (posix) wrapper. This means that the error return value is not necessarily -1 and that errno is not set by the call. For InitPrctl this means that the checks do not catch running on a kernel *without* the required ABI (not caught since I only tested this function correctly enables the ABI when it exists). This commit updates the two calls which check for an error condition to use `internal_iserror`. That function sets a provided integer to an equivalent errno value and returns a boolean to indicate success or not. Tested by running on a kernel that has this ABI and on one that does not. Verified that running on the kernel without this ABI the current code prints the provided error message and does not attempt to run the program. Verified that running on the kernel with this ABI the current code does not print an error message and turns on the ABI. All tests done on an AArch64 Linux machine. Reviewed By: eugenis Differential Revision: https://reviews.llvm.org/D94425
Diffstat (limited to 'llvm/unittests/Analysis/ValueTrackingTest.cpp')
0 files changed, 0 insertions, 0 deletions