public inbox for gdb-testers@sourceware.org help / color / mirror / Atom feed
From: gdb-buildbot@sergiodj.net To: gdb-testers@sourceware.org Subject: [binutils-gdb] Stop potential illegal memory access in the NS32K disassembler. Date: Mon, 28 Oct 2019 16:36:00 -0000 [thread overview] Message-ID: <d1e304bc27b737e0e7daf0029dd5f1e91a4898ed@gdb-build> (raw) *** TEST RESULTS FOR COMMIT d1e304bc27b737e0e7daf0029dd5f1e91a4898ed *** commit d1e304bc27b737e0e7daf0029dd5f1e91a4898ed Author: Nick Clifton <nickc@redhat.com> AuthorDate: Mon Oct 28 15:44:23 2019 +0000 Commit: Nick Clifton <nickc@redhat.com> CommitDate: Mon Oct 28 15:44:23 2019 +0000 Stop potential illegal memory access in the NS32K disassembler. * ns32k-dis.c (bit_extract): Add sanitiy check of parameters. (bit_extract_simple): Likewise. (bit_copy): Likewise. (pirnt_insn_ns32k): Ensure that uninitialised elements in the index_offset array are not accessed. diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 66df91109e..fe0f2402d7 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,11 @@ +2019-10-28 Nick Clifton <nickc@redhat.com> + + * ns32k-dis.c (bit_extract): Add sanitiy check of parameters. + (bit_extract_simple): Likewise. + (bit_copy): Likewise. + (pirnt_insn_ns32k): Ensure that uninitialised elements in the + index_offset array are not accessed. + 2019-10-28 Nick Clifton <nickc@redhat.com> * xgate-dis.c (print_insn): Fix decoding of the XGATE_OP_DYA diff --git a/opcodes/ns32k-dis.c b/opcodes/ns32k-dis.c index 1fffbd8d11..22a9389ecf 100644 --- a/opcodes/ns32k-dis.c +++ b/opcodes/ns32k-dis.c @@ -265,6 +265,8 @@ bit_extract (bfd_byte *buffer, int offset, int count) int result; int bit; + if (offset < 0 || count < 0) + return 0; buffer += offset >> 3; offset &= 7; bit = 1; @@ -292,6 +294,8 @@ bit_extract_simple (bfd_byte *buffer, int offset, int count) int result; int bit; + if (offset < 0 || count < 0) + return 0; buffer += offset >> 3; offset &= 7; bit = 1; @@ -313,6 +317,8 @@ bit_extract_simple (bfd_byte *buffer, int offset, int count) static void bit_copy (bfd_byte *buffer, int offset, int count, char *to) { + if (offset < 0 || count < 0) + return; for (; count > 8; count -= 8, to++, offset += 8) *to = bit_extract (buffer, offset, 8); *to = bit_extract (buffer, offset, count); @@ -836,8 +842,10 @@ print_insn_ns32k (bfd_vma memaddr, disassemble_info *info) memaddr, arg_bufs[argnum], index_offset[whicharg]); d++; - whicharg++; + if (whicharg++ >= 1) + break; } + for (argnum = 0; argnum <= maxarg; argnum++) { bfd_vma addr;
next reply other threads:[~2019-10-28 16:36 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-10-28 16:36 gdb-buildbot [this message] 2019-10-28 16:36 ` Failures on Ubuntu-Aarch64-native-gdbserver-m64, branch master gdb-buildbot 2019-11-14 6:32 ` Failures on Fedora-i686, " gdb-buildbot 2019-11-14 7:31 ` Failures on Fedora-x86_64-m64, " gdb-buildbot 2019-11-14 8:27 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " gdb-buildbot 2019-11-14 8:28 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " gdb-buildbot 2019-11-14 9:15 ` Failures on Fedora-x86_64-native-gdbserver-m64, " gdb-buildbot
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=d1e304bc27b737e0e7daf0029dd5f1e91a4898ed@gdb-build \ --to=gdb-buildbot@sergiodj.net \ --cc=gdb-testers@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: linkBe 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).