Skip to content

Fix heap bins tcache from accessing invalid addresses on glibc 2.42#1197

Closed
B1ackCat wants to merge 1 commit into
hugsy:mainfrom
B1ackCat:fix/tcache
Closed

Fix heap bins tcache from accessing invalid addresses on glibc 2.42#1197
B1ackCat wants to merge 1 commit into
hugsy:mainfrom
B1ackCat:fix/tcache

Conversation

@B1ackCat

Copy link
Copy Markdown

Description

Fix for heap bins tcache accessing invalid addresses on glibc 2.42.
Also adding a sanity check to ensure only properly aligned tcache entry pointers are traversed.

With the current implementation, when parsing tcache bins, corrupted values in the entry array (e.g. 0x7000…) can be misinterpreted as valid pointers. This causes gdb to dereference invalid memory and the command fails.

The fix adds a simple ptrsize-alignment check before constructing a GlibcTcacheChunk.
Since real heap chunk pointers are always ptrsize-aligned, this prevents mis-parsing and avoids invalid memory accesses without affecting normal behavior.

Checklist

  • My code follows the code style of this project.
  • My change includes a change to the documentation, if required.
  • If my change adds new code, adequate tests have been added.
  • I have read and agree to the CONTRIBUTING document.

@github-actions

Copy link
Copy Markdown

🤖 Coverage update for 64ec7d7 🔴

Old New
Commit ee605f9 64ec7d7
Score 71.0775% 71.0582% (-0.0193)

@stale

stale Bot commented Nov 15, 2025

Copy link
Copy Markdown

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 Nov 15, 2025
@stale

stale Bot commented Dec 16, 2025

Copy link
Copy Markdown

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 Dec 16, 2025
@gordonmessmer

Copy link
Copy Markdown
Contributor

@hugsy @Grazfather Please merge these changes. CI testing confirms that this change fixes the test failures I see on Fedora > 43.

gordonmessmer#3

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants