https://sourceware.org/bugzilla/show_bug.cgi?id=34325

            Bug ID: 34325
           Summary: readelf: SIGSEGV in dump_relr_relocations when
                    processing ELF relocation data
           Product: binutils
           Version: 2.47 (HEAD)
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: 970429025 at qq dot com
  Target Milestone: ---

Created attachment 16799
  --> https://sourceware.org/bugzilla/attachment.cgi?id=16799&action=edit
The PoC attachment contains the input file (Null_Pointer_2) that triggers this
behavior.

Overview:

Running readelf with -a -D on a ELF input file causes the program to crash with
SIGSEGV.

The crash occurs in dump_relr_relocations() while processing relocation
information.

Steps to Reproduce:

./readelf -a -D Null_Pointer_2

Actual Results:

readelf terminates with SIGSEGV.

GDB output excerpt:

Program received signal SIGSEGV, Segmentation fault.

#0  0x0000000000476186 in dump_relr_relocations ()
#1  0x0000000000450958 in process_relocs ()
#2  0x0000000000441a83 in process_object ()
#3  0x000000000043260b in process_file ()
#4  0x00000000004305b6 in main ()

Expected Results:

readelf should exit gracefully after reporting an error or warning, rather than
crashing with SIGSEGV.

Build & Platform:

binutils version: GNU Binutils 2.46.50.20260601
component: readelf
OS: Ubuntu 22.04.5 LTS
arch: x86_64

Additional Information:

The PoC attachment contains the input file that triggers the crash:
Null_Pointer_2.

Crash type: SIGSEGV
Crash location: dump_relr_relocations()
Affected option: -D
Fully reproducible.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to