public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH]forbid ptrace changes psr.ri to 3
@ 2007-08-16  6:16 Shaohua Li
  2007-08-17  6:01 ` Roland McGrath
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Shaohua Li @ 2007-08-16  6:16 UTC (permalink / raw)
  To: linux-ia64

PSR.ri bits 3 are reserved, change to 3 will break kernel.

The patch ignore such change, if you thought access_urea should return
an error in the case, please let me know.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>

--- a/arch/ia64/kernel/ptrace.c	2007-08-27 05:48:49.000000000 +0800
+++ b/arch/ia64/kernel/ptrace.c	2007-08-27 05:57:42.000000000 +0800
@@ -951,10 +951,14 @@ access_uarea (struct task_struct *child,
 			return 0;
 
 		      case PT_CR_IPSR:
-			if (write_access)
-				pt->cr_ipsr = ((*data & IPSR_MASK)
+			if (write_access) {
+				unsigned long tmp = *data;
+				/* psr.ri bits 11 are reserved, ingore the change */
+				if ((tmp & IA64_PSR_RI) = IA64_PSR_RI)
+					tmp &= ~IA64_PSR_RI;
+				pt->cr_ipsr = ((tmp & IPSR_MASK)
 					       | (pt->cr_ipsr & ~IPSR_MASK));
-			else
+			} else
 				*data = (pt->cr_ipsr & IPSR_MASK);
 			return 0;
 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-08-17 18:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-16  6:16 [PATCH]forbid ptrace changes psr.ri to 3 Shaohua Li
2007-08-17  6:01 ` Roland McGrath
2007-08-17 17:21 ` Luck, Tony
2007-08-17 18:40 ` Bjorn Helgaas
2007-08-17 18:44 ` Luck, Tony
2007-08-17 18:47 ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox