hugsy / gef

GEF (GDB Enhanced Features) - a modern experience for GDB with advanced debugging capabilities for exploit devs & reverse engineers on Linux
https://hugsy.github.io/gef
MIT License
6.88k stars 728 forks source link

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

Closed Grazfather closed 6 days ago

Grazfather commented 8 months ago

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

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

stale[bot] commented 6 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. You can reopen it by adding a comment to this issue.

stale[bot] commented 3 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. You can reopen it by adding a comment to this issue.

stale[bot] commented 2 months ago

This issue has been automatically closed because it has not had recent activity. If you are the owner of this issue, you can either re-open it and provide a more complete description; or create a new issue. Thank you for your contributions.

Grazfather commented 2 months ago

Wasn't this fixed? Will close with the proper tag

hugsy commented 2 months ago

Wasn't this fixed? Will close with the proper tag

Not yet, it's under review. I attached the PR to this issue so StaleBot won't close it.

stale[bot] commented 6 days ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. You can reopen it by adding a comment to this issue.