In PCuABI, mremap() gets passed a capability with bounds that are narrower than memsize, which results in the syscall failing early with -EINVAL.
Expect EINVAL in PCuABI only, as it is probably inappropriate on other ABIs.
Signed-off-by: Kevin Brodsky kevin.brodsky@arm.com --- testcases/kernel/syscalls/mremap/mremap03.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/testcases/kernel/syscalls/mremap/mremap03.c b/testcases/kernel/syscalls/mremap/mremap03.c index 02b79bc47bba..9ea7b64a47fc 100644 --- a/testcases/kernel/syscalls/mremap/mremap03.c +++ b/testcases/kernel/syscalls/mremap/mremap03.c @@ -131,6 +131,11 @@ int main(int ac, char **av) if (errno == EFAULT) { tst_resm(TPASS, "mremap() Fails, 'old region not " "mapped', errno %d", TEST_ERRNO); +#ifdef __CHERI_PURE_CAPABILITY__ + } else if (errno == EINVAL) { + tst_resm(TPASS, "mremap() Fails, 'invalid capability', " + "errno %d", TEST_ERRNO); +#endif } else { tst_resm(TFAIL, "mremap() Fails, " "'Unexpected errno %d", TEST_ERRNO);