From: H.J. Lu Date: Tue, 30 Sep 2025 00:39:34 +0000 (+0800) Subject: elf: Don't read beyond .eh_frame section end X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e4f355f13be7fd4b165fe3ec3349ece972db05db;p=thirdparty%2Fbinutils-gdb.git elf: Don't read beyond .eh_frame section end PR ld/33500 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Don't read beyond the .eh_frame section end. Signed-off-by: H.J. Lu --- diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c index 30bb313489c..4eda3c991bb 100644 --- a/bfd/elf-eh-frame.c +++ b/bfd/elf-eh-frame.c @@ -761,6 +761,7 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info, strcpy (cie->augmentation, (char *) buf); buf = (bfd_byte *) null_byte + 1; + REQUIRE (buf + 1 < end); this_inf->u.cie.aug_str_len = buf - start - 1; ENSURE_NO_RELOCS (buf); if (buf[0] == 'e' && buf[1] == 'h')