Repository navigation
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 Re-keyed 2026-08-28. The figures above were measured at Re-keyed again 2026-09-06. The branch was rebased from baseline That bounds the diff and not the loader, so the figures above do not carry over untouched: master changed The reason for the rebase: the previous baseline predates cle Amended 2026-09-06. The head moved from CI status, head Corpus attribution, 2026-08-28, keyed to head A category sweep, deduplicated by object digest, scores 460,618 distinct objects and asks whether a recovered block starts outside every executable region the file itself declares. 17,441 objects carry at least one, 1,918,593 blocks in total. ELF core dumps are 4,971 of those objects and 324,017 of the blocks, and the rate is the point: 97.8% of the 5,081 core dumps the sweep scored for placement carry the finding, 4,971 of 5,081. A rate that high is a property of how the format is loaded, not of individual objects. The mechanism, confirmed against the cores' own program header tables read out of the files rather than through CLE: Measured over 34 core dumps across five architectures, which reproduce the sweep's own block count and finding count exactly on 34 of 34:
The map is a stronger check than the count. With the pair applied, the executable memory angr scans over those 34 cores falls from 74,215,424 bytes to 3,031,040 — exactly the byte total of the cores' own The two changes are required together, and the figures above were measured with both. #758 supplies the permissions the core recorded; angr/angr#6864 makes the CFG read a blob's executable map from its segments instead of calling the whole blob executable. Neither alone moves this category, so attributing the result to either would overstate it. What this category is once its Mach-O majority is set aside. 82.5% of its blocks and 70.0% of its objects are Mach-O — 1,582,505 of 1,918,593 blocks and 12,212 of 17,441 objects — and that share was already fixed before this analysis began, by cle Where the growth over the sweep's revisions comes from, and that this pair absorbs it too. Added 2026-08-28, keyed to head The table above records current master at 6,479 flagged blocks against 5,445 at the sweep's revisions. A bisect over the 64 angr commits between those two, with cle, pyvex and archinfo held fixed at master so any delta is an angr delta and The added blocks are wrong rather than merely extra. Classifying each flagged block by the Both heads above contain
Per object the map is the stronger check, as it is over the 34 cores above. With the pair applied, the executable memory angr scans on the x86 core narrows from 2,211,840 bytes to 1,994,752 — exactly the total of that core's own So the elfcore side of this category is fully absorbed, increment included, and reverting |
|
Corpus decompilation diffs can be found at angr/dec-snapshots@master...angr/cle_758 |
ecc13a0 to
d097296
Compare
d097296 to
8c4492f
Compare
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS The permissions of every blob segment cut out of the core dump, beside the permissions the core's own program header states for the mapping it came from. the reproducerimport logging, os
logging.getLogger("cle").setLevel(logging.CRITICAL)
import cle
BIN = os.environ["BINARIES"] # a checkout of angr/binaries
T = lambda *p: os.path.join(BIN, "tests", *p)
core = T("x86_64", "coredump", "true-libc.so.6-ld-linux-x86-64.so.2.core")
ld = cle.Loader(core, main_opts={"backend": "elfcore",
"remote_file_mapper": lambda x: x.replace(
"/tmp/foobar/does-not-exist", T("x86_64"))},
auto_load_libs=True)
blobs = [o for o in ld.all_objects if isinstance(o, cle.Blob)]
print(f"{len(blobs)} mappings became blobs; blob segment perms vs the core's own program header")
print(f"{'segment':>22} {'blob':>5} {'core':>5}")
def p(r):
return ("r" if r.is_readable else "-") + ("w" if r.is_writable else "-") + ("x" if r.is_executable else "-")
for blob in blobs:
for seg in blob.segments:
src = ld.elfcore_object.segments.find_region_containing(seg.vaddr)
print(f"{seg.vaddr:#018x} {p(seg):>5} {p(src):>5}")Before — every blob claims rwx, including the heap, the stack and the two rw- data mappings: cle master at
|
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS How much of a corpus's analysis surface this cleans up, measured rather than Sample. 12,000 objects drawn uniformly at random, from a seeded permutation, Method. All 98 core dumps are loaded with the catalogue's declared recipe Result. On the 91 that complete, function count falls from 7,663 to 6,569 Those are phantom functions, checked rather than assumed. Taking the dump One correction to our own notes. We had this change filed against the The corpus is not redistributable, so its objects are described by architecture, session: sharpen |
8c4492f to
907ee1e
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; with the triple, Blob builds a PermissionedSegment, which answers from the flags instead. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
907ee1e to
2b577d7
Compare
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS
Problem
A core dump records what every mapping was allowed to do, and
ELFCorereads itcorrectly -- then loses it on the way out. On
binaries/tests/x86_64/coredump/true-libc.so.6-ld-linux-x86-64.so.2.core, thefive mappings that do not belong to a child object become blobs, and every one of
them claims to be executable:
Those four
rw-mappings are the heap, the ld.so and libc data segments and thestack. Anything that asks the loader which memory is code -- CFGFast's executable
map first of all -- is told all of it is.
Root cause
ELFCorehands each mapping it could not match to a child object toBlob,which builds a plain
Segment, andSegmentinheritsRegion's defaults:That default is right for the format
Blobwas written for -- a raw image recordsno permissions, so refusing to answer would be worse -- and wrong the moment the
caller does know them. The
p_flagsthe core states are read, matched againstchild objects, and then dropped at the one point where a
Segmentis constructed.Fix
PermissionedSegmentstates its three permissions instead of assuming them,Blobtakes an optionalpermissionstriple describing the memory it came from,and
ELFCorepasses each mapping's flags through -- including to the leading andtrailing offcuts it makes when a mapping only partly overlaps a child, which are
parts of the same mapping and get the same flags. A blob loaded from a raw image
is unchanged, because the triple defaults to
Noneand the old behaviour with it.Testing
tests/test_elfcore.py::test_blob_children_keep_the_mapping_permissionscomparesevery blob segment of the core fixture against the program header it was cut
from, and asserts at least one is not executable; on the merge base the heap blob
reports
rwxwhere the core saysp_flags 0x6.Fixes #743. angr/angr#6864 is the other half, where CFGFast's executable map
learns to read these permissions.
Validation: #758 (comment)
sync: angr/angr#6864
session: sharpen