public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Paul Iannetta <piannetta@kalrayinc.com>
To: Alan Modra <amodra@gmail.com>
Cc: binutils@sourceware.org
Subject: Re: [PATCH] kvx: fix kvx_reassemble_bundle index 8 out of bounds
Date: Thu, 24 Aug 2023 10:49:06 +0200	[thread overview]
Message-ID: <20230824084906.svfkw5r7xxws2prc@ws2202.lin.mbt.kalray.eu> (raw)
In-Reply-To: <ZObKoYxR9ADFli3o@squeak.grove.modra.org>

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

On Thu, Aug 24, 2023 at 12:42:33PM +0930, Alan Modra wrote:
> On Wed, Aug 23, 2023 at 04:39:19PM +0200, Paul Iannetta via Binutils wrote:
> > As discussed earlier, I removed kvx_elf64_linux_vec, fix the handling of unique
> > symbols by using has_gnu_osabi instead of overwriting e_ident, change (unsigned)
> > long long into {u,}int64 and at some place int by int32_t.
> 
> I've committed these for you.  BTW, oss-fuzz is poking at the kvx
> support and finding holes.  See pr30793.

The attached patch should fix pr30793.

Thanks,
Paul



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-kvx-fix-kvx_reassemble_bundle-index-8-out-of-bounds.patch --]
[-- Type: text/x-diff, Size: 1000 bytes --]

From 03c35cf18fa689bc7d727c506d30c396244cb307 Mon Sep 17 00:00:00 2001
From: Paul Iannetta <piannetta@kalrayinc.com>
Date: Thu, 24 Aug 2023 10:39:14 +0200
Subject: [PATCH] kvx: fix kvx_reassemble_bundle index 8 out of bounds

opcodes/ChangeLog:

2023-08-24  Paul Iannetta  <piannetta@kalrayinc.com>

	* kvx-dis.c (print_insn_kvx): Change the loop condition so that
	  wordcount is always less than KVXMAXBUNDLEWORDS.
---
 opcodes/kvx-dis.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/opcodes/kvx-dis.c b/opcodes/kvx-dis.c
index e63430a9e57..a78eb5f84ec 100644
--- a/opcodes/kvx-dis.c
+++ b/opcodes/kvx-dis.c
@@ -1056,7 +1056,7 @@ print_insn_kvx (bfd_vma memaddr, struct disassemble_info *info)
 	  wordcount++;
 	}
       while (kvx_has_parallel_bit (bundle_words[wordcount - 1])
-	     && wordcount < KVXMAXBUNDLEWORDS);
+	     && wordcount < KVXMAXBUNDLEWORDS - 1);
       invalid_bundle = kvx_reassemble_bundle (wordcount, &insncount);
     }
 
-- 
2.35.1.500.gb896f729e2


  parent reply	other threads:[~2023-08-24  8:49 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-22 16:01 [PATCH] kvx: fix 32-bit build and validation Paul Iannetta
2023-08-23  0:27 ` Alan Modra
2023-08-23  7:44   ` Paul Iannetta
2023-08-23 12:14     ` Alan Modra
2023-08-23 14:39       ` [PATCH 0/4] kvx: various fixes Paul Iannetta
2023-08-23 14:39         ` [PATCH 1/4] kvx: remove kvx_elf64_linux_vec Paul Iannetta
2023-08-23 14:39         ` [PATCH 2/4] kvx: fix handling of STB_GNU_UNIQUE symbols Paul Iannetta
2023-08-23 14:39         ` [PATCH 3/4] kvx: use {u,}int32_t and {u,}int64_t Paul Iannetta
2023-08-23 14:39         ` [PATCH 4/4] kvx: bfd/config.bfd & ld/configure.tgt Paul Iannetta
2023-08-24  3:12         ` [PATCH 0/4] kvx: various fixes Alan Modra
2023-08-24  6:26           ` Paul Iannetta
2023-08-24  8:49           ` Paul Iannetta [this message]
2023-08-24  9:08             ` [PATCH] kvx: fix kvx_reassemble_bundle index 8 out of bounds Alan Modra
2023-08-24  9:26               ` Paul Iannetta
2023-09-07 12:46                 ` Alan Modra
2023-09-07 15:27                   ` Paul Iannetta
2023-08-23 14:40       ` [PATCH] kvx: fix 32-bit build and validation Paul Iannetta
2023-08-23  3:16 ` Alan Modra
2023-08-23 13:39   ` Luis Machado

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=20230824084906.svfkw5r7xxws2prc@ws2202.lin.mbt.kalray.eu \
    --to=piannetta@kalrayinc.com \
    --cc=amodra@gmail.com \
    --cc=binutils@sourceware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).