public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [Linux-ia64] [PATCH] IA-32 emulation patch: ptrace get_FPREGS bug fix
@ 2003-05-31  1:19 Pallipadi, Venkatesh
  2003-05-31  3:13 ` David Mosberger
  2003-06-03 15:57 ` Bjorn Helgaas
  0 siblings, 2 replies; 3+ messages in thread
From: Pallipadi, Venkatesh @ 2003-05-31  1:19 UTC (permalink / raw)
  To: linux-ia64

[-- Attachment #1: Type: text/plain, Size: 671 bytes --]



A bug-fix in IA-32 emulation ptrace code. The bug originally got
introduced with the addition of FPXREGS support in ptrace.

The bug is in ptrace get/set FPREGS routine. gdb by default will not use
FPREGS routines when FPXREGS routines are supported.  So we may not see
this bug during normal gdb operations. But, if gdb (or any other app)
directly tries to get/set FPREGS (probably an old version of gdb), it
will end with an segmentation fault due to this bug.

Attached patch fixes the issue. The patch is taken against 2.5.69. But
it applies to 2.4 tree as well. 

Please let me know, if you need any more information on this.

Thanks,
-Venkatesh

[-- Attachment #2: ptrace_2569.patch --]
[-- Type: application/octet-stream, Size: 1210 bytes --]

diff -urN linux-2.5.69/arch/ia64/ia32/sys_ia32.c linux-2.5.69-fix/arch/ia64/ia32/sys_ia32.c
--- linux-2.5.69/arch/ia64/ia32/sys_ia32.c	Mon May 12 14:20:23 2003
+++ linux-2.5.69-fix/arch/ia64/ia32/sys_ia32.c	Fri May 30 11:26:25 2003
@@ -1860,7 +1860,7 @@
 	ptp = ia64_task_regs(tsk);
 	tos = (tsk->thread.fsr >> 11) & 7;
 	for (i = 0; i < 8; i++)
-		put_fpreg(i, (struct _fpreg_ia32 *)&save->st_space[4*i], ptp, swp, tos);
+		put_fpreg(i, &save->st_space[i], ptp, swp, tos);
 	return 0;
 }
 
@@ -1893,7 +1893,7 @@
 	ptp = ia64_task_regs(tsk);
 	tos = (tsk->thread.fsr >> 11) & 7;
 	for (i = 0; i < 8; i++)
-		get_fpreg(i, (struct _fpreg_ia32 *)&save->st_space[4*i], ptp, swp, tos);
+		get_fpreg(i, &save->st_space[i], ptp, swp, tos);
 	return 0;
 }
 
diff -urN linux-2.5.69/include/asm-ia64/ia32.h linux-2.5.69-fix/include/asm-ia64/ia32.h
--- linux-2.5.69/include/asm-ia64/ia32.h	Mon May 12 14:20:32 2003
+++ linux-2.5.69-fix/include/asm-ia64/ia32.h	Fri May 30 11:26:25 2003
@@ -108,7 +108,8 @@
 	int	fcs;
 	int	foo;
 	int	fos;
-	int	st_space[20];	/* 8*10 bytes for each FP-reg = 80 bytes */
+	/* 8*10 bytes for each FP-reg = 80 bytes */
+	struct _fpreg_ia32 	st_space[8];
 };
 
 struct ia32_user_fxsr_struct {

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

* Re: [Linux-ia64] [PATCH] IA-32 emulation patch: ptrace get_FPREGS bug fix
  2003-05-31  1:19 [Linux-ia64] [PATCH] IA-32 emulation patch: ptrace get_FPREGS bug fix Pallipadi, Venkatesh
@ 2003-05-31  3:13 ` David Mosberger
  2003-06-03 15:57 ` Bjorn Helgaas
  1 sibling, 0 replies; 3+ messages in thread
From: David Mosberger @ 2003-05-31  3:13 UTC (permalink / raw)
  To: linux-ia64

>>>>> On Fri, 30 May 2003 18:19:02 -0700, "Pallipadi, Venkatesh" <venkatesh.pallipadi@intel.com> said:

  Venkatesh> A bug-fix in IA-32 emulation ptrace code. The bug
  Venkatesh> originally got introduced with the addition of FPXREGS
  Venkatesh> support in ptrace.

Applied, thanks.

	--david


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

* Re: [Linux-ia64] [PATCH] IA-32 emulation patch: ptrace get_FPREGS bug fix
  2003-05-31  1:19 [Linux-ia64] [PATCH] IA-32 emulation patch: ptrace get_FPREGS bug fix Pallipadi, Venkatesh
  2003-05-31  3:13 ` David Mosberger
@ 2003-06-03 15:57 ` Bjorn Helgaas
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Helgaas @ 2003-06-03 15:57 UTC (permalink / raw)
  To: linux-ia64

On Friday 30 May 2003 7:19 pm, Pallipadi, Venkatesh wrote:
> A bug-fix in IA-32 emulation ptrace code. The bug originally got
> introduced with the addition of FPXREGS support in ptrace.

I applied this for 2.4.  Thanks!


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

end of thread, other threads:[~2003-06-03 15:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-31  1:19 [Linux-ia64] [PATCH] IA-32 emulation patch: ptrace get_FPREGS bug fix Pallipadi, Venkatesh
2003-05-31  3:13 ` David Mosberger
2003-06-03 15:57 ` Bjorn Helgaas

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