ELFCore: Keep the permissions of the mappings it turns into blobs - #758
ELFCore: Keep the permissions of the mappings it turns into blobs#758zardus wants to merge 1 commit into
Conversation
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS Validation record for head
Corpus A/B over 225 ELF core dumps, sampled 25 per (collection, architecture) from a private corpus of 5,250, one object per forked child and one side per child. 169 have all four runs clean; 56 fail identically on every side and are unaffected. The executable map scored against is the core's own
Caveats: corpus objects are named by architecture, container and digest because the dataset is not public; the regression uses Corpus impact, measured after this pull request was openedA CFGFast sweep scores every recovered block against the file's own evidence and The five heaviest contributors were fetched and their recorded sample addresses
160 of 160 sampled addresses sit in a The sweep pins a CLE from before this pull request, so those figures describe the Reproducing needs only a core dump with writable data mappings: every block The other side of that comparisonThe figures above are the unfixed behaviour. Re-running the same three core dumps
Before the change those same objects contributed 1,620, 393 and 393 findings, and Worth noting the x86 case recovers more blocks than the finding count would Measured with the pair applied, because they are companions: this supplies the |
|
Corpus decompilation diffs can be found at angr/dec-snapshots@master...angr/cle_758 |
002dfc4 to
6e74474
Compare
A core dump records what every mapping of the crashed process was allowed to do, and ELFCore reads that correctly: its own segments report r-x, rw- and --- exactly as the program headers spell them. The mappings it cannot match to a child object are then handed to Blob, and the permissions do not go with them. Blob builds a plain Segment, whose base Region answers True to every permission query, so the heap, the stack, the ELF header page and the ---p guard pages all reach the loader as executable memory. The pieces a mapping is cut into when a child object covers part of it lost the permissions the same way, before they ever reached Blob. Give Blob an optional permissions triple describing the memory it was taken from, and pass the segment's own flags through from ELFCore. A blob loaded from a raw image still reports everything permissive, because a raw image records nothing to the contrary; permissions_known says which of the two a caller is looking at. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
6e74474 to
ecc13a0
Compare
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS
A core dump records what every mapping was allowed to do, and
ELFCorereads itcorrectly. The mappings it cannot match to a child object are then handed to
Blob, which builds a plainSegmentwhose baseRegionanswersTruetoevery permission query, so the heap, the stack and the
---pguard pages allreach the loader as executable memory.
Blobnow takes an optional permissions triple describing the memory it camefrom, and
ELFCorepasses each mapping's flags through. A blob loaded from araw image is unchanged, because a raw image records nothing to the contrary.
The regression compares every blob segment of the core-dump fixture against the
mapping it was cut from; on master the heap blob reports
rwxwhere the programheader says
p_flags 0x6.Fixes #743. angr/angr#6864 is the other half, where CFGFast's
executable map learns to read these permissions.
Validation: #758 (comment)