diff options
author | Petr Tesarik <ptesarik@suse.cz> | 2007-12-12 09:23:34 -0500 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2008-02-08 15:01:18 -0500 |
commit | 3b2ce0b17824c42bc2e46f7dd903b4acf5e9fff9 (patch) | |
tree | acf3913f8c0a479615060ffed4cec9283047761c /arch/ia64/kernel/process.c | |
parent | 5aa92ffda1b6244b4a248df0b95c07d183ab96d2 (diff) |
[IA64] Synchronize kernel RSE to user-space and back
This is base kernel patch for ptrace RSE bug. It's basically a backport
from the utrace RSE patch I sent out several weeks ago. please review.
when a thread is stopped (ptraced), debugger might change thread's user
stack (change memory directly), and we must avoid the RSE stored in
kernel to override user stack (user space's RSE is newer than kernel's
in the case). To workaround the issue, we copy kernel RSE to user RSE
before the task is stopped, so user RSE has updated data. we then copy
user RSE to kernel after the task is resummed from traced stop and
kernel will use the newer RSE to return to user.
Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Petr Tesarik <ptesarik@suse.cz>
CC: Roland McGrath <roland@redhat.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64/kernel/process.c')
-rw-r--r-- | arch/ia64/kernel/process.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c index 5c9efe626563..be6c6f7be027 100644 --- a/arch/ia64/kernel/process.c +++ b/arch/ia64/kernel/process.c | |||
@@ -163,6 +163,8 @@ void tsk_clear_notify_resume(struct task_struct *tsk) | |||
163 | if (tsk->thread.pfm_needs_checking) | 163 | if (tsk->thread.pfm_needs_checking) |
164 | return; | 164 | return; |
165 | #endif | 165 | #endif |
166 | if (test_ti_thread_flag(task_thread_info(tsk), TIF_RESTORE_RSE)) | ||
167 | return; | ||
166 | clear_ti_thread_flag(task_thread_info(tsk), TIF_NOTIFY_RESUME); | 168 | clear_ti_thread_flag(task_thread_info(tsk), TIF_NOTIFY_RESUME); |
167 | } | 169 | } |
168 | 170 | ||
@@ -184,6 +186,10 @@ do_notify_resume_user (sigset_t *unused, struct sigscratch *scr, long in_syscall | |||
184 | /* deal with pending signal delivery */ | 186 | /* deal with pending signal delivery */ |
185 | if (test_thread_flag(TIF_SIGPENDING)||test_thread_flag(TIF_RESTORE_SIGMASK)) | 187 | if (test_thread_flag(TIF_SIGPENDING)||test_thread_flag(TIF_RESTORE_SIGMASK)) |
186 | ia64_do_signal(scr, in_syscall); | 188 | ia64_do_signal(scr, in_syscall); |
189 | |||
190 | /* copy user rbs to kernel rbs */ | ||
191 | if (unlikely(test_thread_flag(TIF_RESTORE_RSE))) | ||
192 | ia64_sync_krbs(); | ||
187 | } | 193 | } |
188 | 194 | ||
189 | static int pal_halt = 1; | 195 | static int pal_halt = 1; |