Commit 490f7ca4 authored by Luca Barbieri's avatar Luca Barbieri Committed by Linus Torvalds

[PATCH] Clear TLS on execve

This trivial patch causes the TLS to be cleared on execve (code is in
flush_thread).  This is necessary to avoid ESRCH errors when
set_thread_area is asked to choose a free TLS entry after several nested
execve's.

The LDT also has a similar problem, but it is less serious because the
LDT code doesn't scan for free entries.  I'll probably send a patch to
fix this too, unless there is something important relying on this
behavior.
parent 08b27f50
...@@ -247,6 +247,7 @@ void flush_thread(void) ...@@ -247,6 +247,7 @@ void flush_thread(void)
struct task_struct *tsk = current; struct task_struct *tsk = current;
memset(tsk->thread.debugreg, 0, sizeof(unsigned long)*8); memset(tsk->thread.debugreg, 0, sizeof(unsigned long)*8);
memset(tsk->thread.tls_array, 0, sizeof(tsk->thread.tls_array));
/* /*
* Forget coprocessor state.. * Forget coprocessor state..
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment