Skip to content

proc/gdbserial: fix out of bounds access reading registers - #4017

Merged
derekparker merged 1 commit into
go-delve:masterfrom
aarzilli:telemetry-gdbserial
Jun 5, 2025
Merged

derekparker merged 1 commit into
go-delve:masterfrom
aarzilli:telemetry-gdbserial

Conversation

@aarzilli

Copy link
Copy Markdown
Member

It looks like some versions of debugserver in some circumstances will
return the wrong number of bytes when reading some registers.

Check for this condition and return an error instead of panic'ing.

Fixes #4008

It looks like some versions of debugserver in some circumstances will
return the wrong number of bytes when reading some registers.
Check for this condition and return an error instead of panic'ing.

Fixes go-delve#4008

@derekparker derekparker left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@derekparker
derekparker merged commit 3a2409b into go-delve:master Jun 5, 2025
derekparker added a commit to derekparker/delve that referenced this pull request Jun 18, 2025
As seen via go-delve#4017 it's possible
that lldb debugserver, in certain versions and circumstances (the
combination is currently not known) can return incorrect or incomplete
information on CPU registers. Be defensive on this by checking if the
result of `it.regs.Reg(it.regs.LRRegNum)` is nil.

Fixes go-delve#4030
aarzilli pushed a commit that referenced this pull request Jun 21, 2025
As seen via #4017 it's possible
that lldb debugserver, in certain versions and circumstances (the
combination is currently not known) can return incorrect or incomplete
information on CPU registers. Be defensive on this by checking if the
result of `it.regs.Reg(it.regs.LRRegNum)` is nil.

Fixes #4030
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

proc/gdbserial: telemetry report: out of bound index access while reading registers

2 participants