public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] opcodes/metag-dis.c: Fix buffer overflow in MMOV disassembler.
@ 2013-01-11 17:02 Will Newton
  2013-01-14 13:14 ` nick clifton
  0 siblings, 1 reply; 2+ messages in thread
From: Will Newton @ 2013-01-11 17:02 UTC (permalink / raw)
  To: binutils

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

A buffer in the disassembler code was sized too small which
caused erratic behaviour when disassembling certain instructions.

opcodes/ChangeLog:

2013-01-11  Will Newton <will.newton@imgtec.com>

	* metag-dis.c (REG_WIDTH): Increase to 64.

gas/testsuite/ChangeLog:

2013-01-11  Will Newton <will.newton@imgtec.com>

	* gas/metag/metadsp21.d: Fix expected MMOV disassembly.
---
 gas/testsuite/gas/metag/metadsp21.d |   12 ++++++------
 opcodes/metag-dis.c                 |    2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

[-- Attachment #2: 0001-opcodes-metag-dis.c-Fix-buffer-overflow-in-MMOV-disa.patch --]
[-- Type: application/octet-stream, Size: 4617 bytes --]

From 6ffd1a5a557fe4544de5ecf55949bed0d4f2a2a1 Mon Sep 17 00:00:00 2001
From: Will Newton <will.newton@imgtec.com>
Date: Fri, 11 Jan 2013 16:51:27 +0000
Subject: [PATCH] opcodes/metag-dis.c: Fix buffer overflow in MMOV disassembler.

A buffer in the disassembler code was sized too small which
caused erratic behaviour when disassembling certain instructions.

opcodes/ChangeLog:

2013-01-11  Will Newton <will.newton@imgtec.com>

	* metag-dis.c (REG_WIDTH): Increase to 64.

gas/testsuite/ChangeLog:

2013-01-11  Will Newton <will.newton@imgtec.com>

	* gas/metag/metadsp21.d: Fix expected MMOV disassembly.
---
 gas/testsuite/gas/metag/metadsp21.d |   12 ++++++------
 opcodes/metag-dis.c                 |    2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/gas/testsuite/gas/metag/metadsp21.d b/gas/testsuite/gas/metag/metadsp21.d
index d3626e9..1b5681e 100644
--- a/gas/testsuite/gas/metag/metadsp21.d
+++ b/gas/testsuite/gas/metag/metadsp21.d
@@ -26203,14 +26203,14 @@ Disassembly of section \.text:
 .*:	03 c1 ff aa 	D         XSDW      \[D1BW\.1\+D1BWI\.1\+\+\],\[D1BR\.1\+D1BRI\.1\+\+\]
 .*:	19 c1 ff aa 	DL        XSDSB     \[D1BW\.1\+D1BWI\.1\+\+\],\[D1BR\.1\+D1BRI\.1\+\+\]
 .*:	c1 03 b0 ca 	DB        MMOVD     RAM8X32,RAM8X32,RAM8X32,RAM8X32,\[D1Re0\+\+\]
-.*:	c1 3f b0 ca 	DB        MMOVD     RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,RA,\[D1Re0\+\+\]
+.*:	c1 3f b0 ca 	DB        MMOVD     RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,\[D1Re0\+\+\]
 .*:	e1 47 b0 ca 	DB        MMOVD     RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,\[A0FrP\+\+\]
 .*:	a1 c0 b1 ca 	DB        MMOVD     RAM8X32,RAM8X32,\[D0\.7\+\+\]
 .*:	a1 c3 b1 ca 	DB        MMOVD     RAM8X32,RAM8X32,RAM8X32,RAM8X32,\[D0\.7\+\+\]
 .*:	a1 cf b1 ca 	DB        MMOVD     RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,\[D0\.7\+\+\]
-.*:	a1 ff b1 ca 	DB        MMOVD     RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,RA,\[D0\.7\+\+\]
+.*:	a1 ff b1 ca 	DB        MMOVD     RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,\[D0\.7\+\+\]
 .*:	e1 03 b2 ca 	DB        MMOVD     RAM8X32,RAM8X32,RAM8X32,RAM8X32,\[A0\.8\+\+\]
-.*:	e1 3f b2 ca 	DB        MMOVD     RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,RA,\[A0\.8\+\+\]
+.*:	e1 3f b2 ca 	DB        MMOVD     RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,\[A0\.8\+\+\]
 .*:	c1 07 b4 ca 	DB        MMOVD     RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,\[D1\.16\+\+\]
 .*:	c1 00 b8 ca 	DB        MMOVD     RAM8X,RAM8X,\[D1Re0\+\+\]
 .*:	c1 0f b8 ca 	DB        MMOVD     RAM8X,RAM8X,RAM8X,RAM8X,RAM8X,RAM8X,\[D1Re0\+\+\]
@@ -26245,14 +26245,14 @@ Disassembly of section \.text:
 .*:	c1 01 fc ca 	DW        MMOVD     RAMX,RAMX,RAMX,\[D1\.16\+\+\]
 .*:	c1 1f fc ca 	DW        MMOVD     RAMX,RAMX,RAMX,RAMX,RAMX,RAMX,RAMX,\[D1\.16\+\+\]
 .*:	c1 03 b0 cb 	DB        MMOVL     RAM8X32,RAM8X32,RAM8X32,RAM8X32,\[D1Re0\+\+\]
-.*:	c1 3f b0 cb 	DB        MMOVL     RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,RA,\[D1Re0\+\+\]
+.*:	c1 3f b0 cb 	DB        MMOVL     RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,\[D1Re0\+\+\]
 .*:	e1 47 b0 cb 	DB        MMOVL     RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,\[A0FrP\+\+\]
 .*:	a1 c0 b1 cb 	DB        MMOVL     RAM8X32,RAM8X32,\[D0\.7\+\+\]
 .*:	a1 c3 b1 cb 	DB        MMOVL     RAM8X32,RAM8X32,RAM8X32,RAM8X32,\[D0\.7\+\+\]
 .*:	a1 cf b1 cb 	DB        MMOVL     RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,\[D0\.7\+\+\]
-.*:	a1 ff b1 cb 	DB        MMOVL     RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,RA,\[D0\.7\+\+\]
+.*:	a1 ff b1 cb 	DB        MMOVL     RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,\[D0\.7\+\+\]
 .*:	e1 03 b2 cb 	DB        MMOVL     RAM8X32,RAM8X32,RAM8X32,RAM8X32,\[A0\.8\+\+\]
-.*:	e1 3f b2 cb 	DB        MMOVL     RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,RA,\[A0\.8\+\+\]
+.*:	e1 3f b2 cb 	DB        MMOVL     RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,\[A0\.8\+\+\]
 .*:	c1 07 b4 cb 	DB        MMOVL     RAM8X32,RAM8X32,RAM8X32,RAM8X32,RAM8X32,\[D1\.16\+\+\]
 .*:	c1 00 b8 cb 	DB        MMOVL     RAM8X,RAM8X,\[D1Re0\+\+\]
 .*:	c1 0f b8 cb 	DB        MMOVL     RAM8X,RAM8X,RAM8X,RAM8X,RAM8X,RAM8X,\[D1Re0\+\+\]
diff --git a/opcodes/metag-dis.c b/opcodes/metag-dis.c
index 8a03a92..447f6de 100644
--- a/opcodes/metag-dis.c
+++ b/opcodes/metag-dis.c
@@ -33,7 +33,7 @@
 
 #define OPERAND_WIDTH   92
 #define ADDR_WIDTH      20
-#define REG_WIDTH       50
+#define REG_WIDTH       64
 #define DSP_PREFIX_WIDTH 17
 
 /* Value to print if we fail to parse a register name.  */
-- 
1.7.1


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

* Re: [PATCH] opcodes/metag-dis.c: Fix buffer overflow in MMOV disassembler.
  2013-01-11 17:02 [PATCH] opcodes/metag-dis.c: Fix buffer overflow in MMOV disassembler Will Newton
@ 2013-01-14 13:14 ` nick clifton
  0 siblings, 0 replies; 2+ messages in thread
From: nick clifton @ 2013-01-14 13:14 UTC (permalink / raw)
  To: Will Newton; +Cc: binutils

Hi  Will,

> opcodes/ChangeLog:
>
> 2013-01-11  Will Newton<will.newton@imgtec.com>
>
> 	* metag-dis.c (REG_WIDTH): Increase to 64.
>
> gas/testsuite/ChangeLog:
>
> 2013-01-11  Will Newton<will.newton@imgtec.com>
>
> 	* gas/metag/metadsp21.d: Fix expected MMOV disassembly.

Approved and applied.

Cheers
   Nick


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

end of thread, other threads:[~2013-01-14 13:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-11 17:02 [PATCH] opcodes/metag-dis.c: Fix buffer overflow in MMOV disassembler Will Newton
2013-01-14 13:14 ` nick clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).