Skip to content

[Bug] read_cstring length can be set so that it reads into an unmapped region #1055

@Grazfather

Description

@Grazfather

GEF+GDB version

2024.01
❯ arm-none-eabi-gdb
GNU gdb (GDB) 13.2

Operating System

OSX

Describe the issue you encountered

When a gef.memory.maps section ends and there is a register set to a value near the end, read_cstring will try to read past the end of the page, into unmapped memory. This causes an error in printing the context.

It seems that we can avoid this with set mem inaccessible-by-default off, but I am not sure we want to.

We might want to instead properly set the length based on our memory maps.

Do you read the docs and look at previously closed issues/PRs for similar cases?

No

Architecture impacted

  • X86
  • X64
  • ARM
  • ARM64
  • MIPS
  • MIPS64
  • PPC
  • PPC64
  • RISCV

Describe your issue. Without a proper reproduction step-by-step, your issue will be ignored.

Provide a step-by-step to reproduce your issue.

Minimalist test case

No response

Additional context?

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions