* [binutils-gdb] Re: Bug 23686, two segment faults in nm
@ 2023-05-20 11:46 Alan Modra
0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2023-05-20 11:46 UTC (permalink / raw)
To: bfd-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0bbd2b1ad0426aee86445cd7f0c86667624da7ca
commit 0bbd2b1ad0426aee86445cd7f0c86667624da7ca
Author: Alan Modra <amodra@gmail.com>
Date: Sat May 20 21:00:25 2023 +0930
Re: Bug 23686, two segment faults in nm
The fix for pr23686 had a hole in the reloc address sanity check,
the calculation could overflow. Note that stabsize is known to be a
non-zero multiple of 12 so stabsize - 4 can't underflow.
PR 23686
* syms.c (_bfd_stab_section_find_nearest_line): Correct
r->address sanity check.
Diff:
---
bfd/syms.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bfd/syms.c b/bfd/syms.c
index 6979096fbc6..d756995d767 100644
--- a/bfd/syms.c
+++ b/bfd/syms.c
@@ -1106,7 +1106,7 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
|| r->howto->pc_relative
|| r->howto->bitpos != 0
|| r->howto->dst_mask != 0xffffffff
- || octets + 4 > stabsize)
+ || octets > stabsize - 4)
{
_bfd_error_handler
(_("unsupported .stab relocation"));
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-05-20 11:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-20 11:46 [binutils-gdb] Re: Bug 23686, two segment faults in nm Alan Modra
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).