Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 of 9 tasks
Grazfather opened this issue Jan 24, 2024 · 6 comments · Fixed by #1112
Closed
1 of 9 tasks

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

Grazfather opened this issue Jan 24, 2024 · 6 comments · Fixed by #1112

Comments

@Grazfather
Copy link
Collaborator

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

@Grazfather Grazfather changed the title [Bug] [Bug] read_cstring length can be set so that it reads into an unmapped region Jan 24, 2024
Copy link

stale bot commented Mar 31, 2024

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.

Copy link

stale bot commented Jun 12, 2024

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 stale bot added the stale label Jun 12, 2024
Copy link

stale bot commented Jul 25, 2024

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.

@stale stale bot closed this as completed Jul 25, 2024
@Grazfather
Copy link
Collaborator Author

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

@Grazfather Grazfather reopened this Jul 27, 2024
@stale stale bot removed the stale label Jul 27, 2024
@hugsy hugsy linked a pull request Jul 27, 2024 that will close this issue
@hugsy
Copy link
Owner

hugsy commented Jul 27, 2024

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.

ValekoZ added a commit to ValekoZ/gef that referenced this issue Sep 19, 2024
Copy link

stale bot commented Sep 29, 2024

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 stale bot added the stale label Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants