From: Carsten Langgaard <carstenl@mips.com>
To: linux-mips@oss.sgi.com
Subject: Bug in get_insn_opcode.
Date: Fri, 02 Mar 2001 17:56:48 +0100 [thread overview]
Message-ID: <3A9FD0D0.887E372F@mips.com> (raw)
There is a bug in the function get_insn_opcode in traps.c
As 'epc' is an int pointer here, it should only be increased by 1 (4
byte) and not by 4 (4*4 = 16 bytes).
See the patch below.
/Carsten
Index: arch/mips/kernel/traps.c
===================================================================
RCS file: /home/repository/sw/linux-2.4.0/arch/mips/kernel/traps.c,v
retrieving revision 1.10
diff -u -r1.10 traps.c
--- traps.c 2001/02/28 13:46:43 1.10
+++ traps.c 2001/03/02 16:50:27
@@ -410,7 +410,7 @@
epc = (unsigned int *) (unsigned long) regs->cp0_epc;
if (regs->cp0_cause & CAUSEF_BD)
- epc += 4;
+ epc++;
if (verify_area(VERIFY_READ, epc, 4)) {
force_sig(SIGSEGV, current);
Index: arch/mips64/kernel/traps.c
===================================================================
RCS file: /home/repository/sw/linux-2.4.0/arch/mips64/kernel/traps.c,v
retrieving revision 1.5
diff -u -r1.5 traps.c
--- traps.c 2001/02/19 16:02:52 1.5
+++ traps.c 2001/03/02 16:50:13
@@ -371,7 +371,7 @@
epc = (unsigned int *) (unsigned long) regs->cp0_epc;
if (regs->cp0_cause & CAUSEF_BD)
- epc += 4;
+ epc++;
if (verify_area(VERIFY_READ, epc, 4)) {
force_sig(SIGSEGV, current);
--
_ _ ____ ___ Carsten Langgaard Mailto:carstenl@mips.com
|\ /|||___)(___ MIPS Denmark Direct: +45 4486 5527
| \/ ||| ____) Lautrupvang 4B Switch: +45 4486 5555
TECHNOLOGIES 2750 Ballerup Fax...: +45 4486 5556
Denmark http://www.mips.com
next reply other threads:[~2001-03-02 16:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-03-02 16:56 Carsten Langgaard [this message]
2001-03-02 18:34 ` Bug in get_insn_opcode Jun Sun
2001-03-03 7:21 ` Ralf Baechle
2001-03-03 15:15 ` Geert Uytterhoeven
2001-03-04 19:48 ` Ralf Baechle
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=3A9FD0D0.887E372F@mips.com \
--to=carstenl@mips.com \
--cc=linux-mips@oss.sgi.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.