From 5dfadd6a810e51bfc65b4fe348798631f829f348 Mon Sep 17 00:00:00 2001 From: Arun Sharma Date: Thu, 3 Jun 2004 03:26:51 -0700 Subject: [PATCH] [PATCH] ia64: tighten FPH state context switch check In the absence of this patch, a process can set it's own mfh bit and potentially view another process's high floating point registers. So a check is needed. Signed-off-by: Arun Sharma Signed-off-by: David Mosberger --- include/asm-ia64/system.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/asm-ia64/system.h b/include/asm-ia64/system.h index 2c53f8dc8046a..57c7db10a42ec 100644 --- a/include/asm-ia64/system.h +++ b/include/asm-ia64/system.h @@ -239,7 +239,7 @@ extern void ia64_load_extra (struct task_struct *task); * the latest fph state from another CPU. In other words: eager save, lazy restore. */ # define switch_to(prev,next,last) do { \ - if (ia64_psr(ia64_task_regs(prev))->mfh) { \ + if (ia64_psr(ia64_task_regs(prev))->mfh && ia64_is_local_fpu_owner(prev)) { \ ia64_psr(ia64_task_regs(prev))->mfh = 0; \ (prev)->thread.flags |= IA64_THREAD_FPH_VALID; \ __ia64_save_fpu((prev)->thread.fph); \ -- 2.53.0