Subject: [PATCH] readelf: Update dynamic tag processing and validate section info

Project / Subsystem

binutils / readelf

Date

2026-07-01

Proposer

"H.J. Lu" <hjl.tools@gmail.com>

Source type

public_inbox

Consensus

Proposed

Sentiment

10/10

Technical tradeoffs

  • Improves robustness against malformed files by ignoring invalid data, potentially hiding underlying issues that might be relevant for debugging.
  • Adds warnings for previously unhandled out-of-range values, providing clearer diagnostics.

All attributes

project
binutils
subsystem
readelf
patch_id
discussion_id
CAMe9rOrB-Y5nRfgKAqjEjNZ3rG7Jxq-fnu7QgFUnzY-TpxxgEA@mail.gmail.com
source_type
public_inbox
title
Subject: [PATCH] readelf: Update dynamic tag processing and validate section info
headline
readelf: Update dynamic tag processing and validate section info
tldr
Improves readelf's handling of dynamic tags and section information, preventing crashes and providing better warnings for invalid data.
proposer
"H.J. Lu" <hjl.tools@gmail.com>
consensus
Proposed
outcome
proposed
sentiment_score
10
technical_tradeoffs
  • Improves robustness against malformed files by ignoring invalid data, potentially hiding underlying issues that might be relevant for debugging.
  • Adds warnings for previously unhandled out-of-range values, providing clearer diagnostics.
series_id
series_role
standalone
series_parts
[]
tags
  • elf
  • readelf
  • security
  • bugfix
  • core-dump
bugzilla_url
date
2026-07-01T00:00:00.000Z

Subject: [PATCH] readelf: Update dynamic tag processing and validate section info

This patch enhances readelf’s robustness by updating its dynamic tag processing and introducing validation for section information. It now correctly counts DT_RELR relocations using dynamic tags when section headers are not present, and crucially, it ignores section sh_offset and sh_size values if they exceed the file size. This prevents segfaults and introduces warnings for out-of-range section data, improving diagnostic capabilities.