Landing: 952275b4a6c4

Project / Subsystem

binutils / risc-v

Date

2026-06-05

Author

Jan Beulich <jbeulich@sourceware.org>

Commit

952275b4a6c44fee709cb47236df9f604327d1d4

Source

public_inbox

Perf win

No

Breaking

No

All attributes

project
binutils
subsystem
risc-v
patch_id
commit_hash
952275b4a6c44fee709cb47236df9f604327d1d4
source_type
public_inbox
headline
Avoid buffer underrun in subset parsing
tldr
The RISC-V ISA extension parser now prevents buffer underruns by adding boundary checks and correcting indentation.
author
Jan Beulich <jbeulich@sourceware.org>
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • risc-v
  • bugfix
  • security
  • parser
discussion_id_link
bugzilla_pr
date
2026-06-05T00:00:00.000Z

This commit fixes a potential buffer underrun vulnerability in the RISC-V ISA extension parsing logic by adding explicit boundary checks. Previous code could attempt to access memory before the start of a buffer when validating extension names, which constitutes undefined behavior. The fix adds q > subset checks before dereferencing *(q - 1) or *(q - 2). Additionally, indentation issues were corrected to improve code readability and maintainability.