Skip to content

Conversation

@B1ackCat
Copy link

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

🤖 Coverage update for 64ec7d7 🔴

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

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.

1 participant