Skip to content

Commit 45631c3

Browse files
Andrew Boienashif
authored andcommitted
tests: stackprot: run in user mode
Ensure that stack canaries work properly in user mode. Signed-off-by: Andrew Boie <[email protected]>
1 parent 01100ea commit 45631c3

File tree

1 file changed

+4
-4
lines changed
  • tests/kernel/mem_protect/stackprot/src

1 file changed

+4
-4
lines changed

tests/kernel/mem_protect/stackprot/src/main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
#define STACKSIZE (2048 + CONFIG_TEST_EXTRA_STACKSIZE)
1414
#define PRIORITY 5
1515

16-
static int count;
17-
static int ret = TC_PASS;
16+
ZTEST_BMEM static int count;
17+
ZTEST_BMEM static int ret = TC_PASS;
1818

1919
void check_input(const char *name, const char *input);
2020

@@ -118,9 +118,9 @@ void test_main(void)
118118
/* Start thread */
119119
k_thread_create(&alt_thread_data, alt_thread_stack_area, STACKSIZE,
120120
(k_thread_entry_t)alternate_thread, NULL, NULL, NULL,
121-
K_PRIO_PREEMPT(PRIORITY), 0, K_NO_WAIT);
121+
K_PRIO_PREEMPT(PRIORITY), K_USER, K_NO_WAIT);
122122

123123
ztest_test_suite(stackprot,
124-
ztest_unit_test(test_stackprot));
124+
ztest_user_unit_test(test_stackprot));
125125
ztest_run_test_suite(stackprot);
126126
}

0 commit comments

Comments
 (0)