public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/2] RISC-V: Fix buffer overflow after long instruction support
@ 2022-10-04  8:59 Tsukasa OI
  2022-10-04  8:59 ` [PATCH 1/2] RISC-V: Fix buffer overflow on print_insn_riscv Tsukasa OI
                   ` (3 more replies)
  0 siblings, 4 replies; 20+ messages in thread
From: Tsukasa OI @ 2022-10-04  8:59 UTC (permalink / raw)
  To: Tsukasa OI, Nelson Chu, Kito Cheng, Palmer Dabbelt,
	Andrew Burgess, Jan Beulich
  Cc: binutils, gdb-patches

Hello,

After commit bb996692bd9 "RISC-V/gas: allow generating up to 176-bit
instructions with .insn", I started to see some crashes while running
"make check-gas".

The cause was simple.  Some functions depended on the fact that maximum
length returned by riscv_insn_length is 8.  But since the commit above
increased that upper limit from 64-bits (8 bytes) to 176-bits (22 bytes),
we need to increase two buffer sizes to avoid crashes.

But note that this change doesn't really support over 64-bit instructions.
It can be said on riscv_insn::fetch_instruction because it now may return
only a part of instruction.
Instead of merging this, reverting that commit (for now) might be an option.

PATCH 1: Binutils
PATCH 2: GDB

Thanks,
Tsukasa




Tsukasa OI (2):
  RISC-V: Fix buffer overflow on print_insn_riscv
  gdb/riscv: Fix buffer overflow on riscv_insn::fetch_instruction

 gdb/riscv-tdep.c    | 2 +-
 opcodes/riscv-dis.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)


base-commit: 034235cebd790d4f9a1728043a175d7d7d9338b1
-- 
2.34.1


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

end of thread, other threads:[~2022-10-04 13:20 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-04  8:59 [PATCH 0/2] RISC-V: Fix buffer overflow after long instruction support Tsukasa OI
2022-10-04  8:59 ` [PATCH 1/2] RISC-V: Fix buffer overflow on print_insn_riscv Tsukasa OI
2022-10-04  8:59 ` [PATCH 2/2] gdb/riscv: Fix buffer overflow on riscv_insn::fetch_instruction Tsukasa OI
2022-10-04  9:04   ` Andreas Schwab
2022-10-04  9:07 ` [PATCH 0/2] RISC-V: Fix buffer overflow after long instruction support Jan Beulich
2022-10-04  9:26   ` Tsukasa OI
2022-10-04  9:44     ` Jan Beulich
2022-10-04  9:47       ` Tsukasa OI
2022-10-04  9:45 ` [PATCH v2 0/2] RISC-V: Fix buffer overflow after 176-bit " Tsukasa OI
2022-10-04  9:45   ` [PATCH v2 1/2] RISC-V: Fix buffer overflow on print_insn_riscv Tsukasa OI
2022-10-04  9:58     ` Jan Beulich
2022-10-04 10:13       ` Tsukasa OI
2022-10-04 10:16         ` Jan Beulich
2022-10-04 10:18           ` Jan Beulich
2022-10-04  9:45   ` [PATCH v2 2/2] gdb/riscv: Partial support for instructions up to 176-bits Tsukasa OI
2022-10-04 11:25   ` [PATCH v3 0/2] RISC-V: Fix buffer overflow after 176-bit instruction support Tsukasa OI
2022-10-04 11:25     ` [PATCH v3 1/2] RISC-V: Fix buffer overflow on print_insn_riscv Tsukasa OI
2022-10-04 11:25     ` [PATCH v3 2/2] gdb/riscv: Partial support for instructions up to 176-bit Tsukasa OI
2022-10-04 12:23     ` [PATCH v3 0/2] RISC-V: Fix buffer overflow after 176-bit instruction support Jan Beulich
2022-10-04 13:20       ` Nelson Chu

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).