kernel: wipe TLS before dropping to user mode
Ensures that TLS from when the thread was in supervisor mode is erased, rather than rely on the arch code to do it. Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
0a07a29c74
commit
743ff98f51
1 changed files with 2 additions and 0 deletions
|
@ -751,6 +751,8 @@ FUNC_NORETURN void k_thread_user_mode_enter(k_thread_entry_t entry,
|
|||
_current->entry.parameter3 = p3;
|
||||
#endif
|
||||
#ifdef CONFIG_USERSPACE
|
||||
memset(_current->userspace_local_data, 0,
|
||||
sizeof(struct _thread_userspace_local_data));
|
||||
arch_user_mode_enter(entry, p1, p2, p3);
|
||||
#else
|
||||
/* XXX In this case we do not reset the stack */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue