From e4f355f13be7fd4b165fe3ec3349ece972db05db Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 30 Sep 2025 08:39:34 +0800 Subject: [PATCH] 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 --- bfd/elf-eh-frame.c | 1 + 1 file changed, 1 insertion(+) 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') -- 2.47.3