From 67aee1f1f69062ad6927fcd259024ac7154c2c72 Mon Sep 17 00:00:00 2001 From: Ioannis Glaropoulos Date: Fri, 22 Feb 2019 13:56:58 +0100 Subject: [PATCH] tests: kernel: userspace: fix test for non-secure builds This commit fixes a test in kernel/mem_protect/userspace, which was attempting to read from an address that was not necessarily within the image memory range, causing faults in ARM TrustZone-enabled builds. Signed-off-by: Ioannis Glaropoulos --- tests/kernel/mem_protect/userspace/src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/kernel/mem_protect/userspace/src/main.c b/tests/kernel/mem_protect/userspace/src/main.c index 4f1912bd854..6b8786cbaee 100644 --- a/tests/kernel/mem_protect/userspace/src/main.c +++ b/tests/kernel/mem_protect/userspace/src/main.c @@ -271,7 +271,7 @@ static void write_kerntext(void) expect_fault = true; expected_reason = REASON_HW_EXCEPTION; BARRIER(); - memcpy(&_is_thread_essential, 0, 4); + memset(&_is_thread_essential, 0, 4); zassert_unreachable("Write to kernel text did not fault"); }