We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 106b1c2 commit 24076abCopy full SHA for 24076ab
tests/kernel/mem_protect/userspace/src/main.c
@@ -103,9 +103,16 @@ static void write_kernram(void)
103
104
extern int _k_neg_eagain;
105
106
+#include <linker/linker-defs.h>
107
+
108
static void write_kernro(void)
109
{
110
/* Try to write to kernel RO. */
111
+ const char *const ptr = (const char *const)&_k_neg_eagain;
112
113
+ zassert_true(ptr < _image_rodata_end &&
114
+ ptr >= _image_rodata_start,
115
+ "_k_neg_eagain is not in rodata\n");
116
_k_neg_eagain = -EINVAL;
117
zassert_unreachable("Write to kernel RO did not fault\n");
118
}
0 commit comments