public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: "Pallipadi, Venkatesh" <venkatesh.pallipadi@intel.com>
To: linux-ia64@vger.kernel.org
Subject: [Linux-ia64] [PATCH] IA-32 emulation patch: ptrace get_FPREGS bug fix
Date: Sat, 31 May 2003 01:19:02 +0000	[thread overview]
Message-ID: <marc-linux-ia64-105590723706099@msgid-missing> (raw)

[-- 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 {

             reply	other threads:[~2003-05-31  1:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-31  1:19 Pallipadi, Venkatesh [this message]
2003-05-31  3:13 ` [Linux-ia64] [PATCH] IA-32 emulation patch: ptrace get_FPREGS bug fix David Mosberger
2003-06-03 15:57 ` Bjorn Helgaas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-linux-ia64-105590723706099@msgid-missing \
    --to=venkatesh.pallipadi@intel.com \
    --cc=linux-ia64@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox