Handle padded archive name tables - #851
Conversation
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS Complete archive-loader result for both unavailable affected inputs, before and after this change. Before — both archives fail while resolving a later GNU filename-table offset: cle master 53d3d24After — both archives load completely: cle with this change 2591eed |
|
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS Validation record for head Candidate validation
Dataset validationThe baseline environment was The four commands below were executed from the same private measurement directory. The confidentiality rule forbids publishing private paths and control identifiers, so J297_BEFORE=/nix/store/c6jb9fgv21zql616kcq5ypxj803wmisa-python3-3.12.13-env
J297_TARGET_MANIFEST=PRIVATE_TARGET_MANIFEST
"$J297_BEFORE/bin/python" -P measure_archives.py --manifest "$J297_TARGET_MANIFEST"
J297_BEFORE=/nix/store/c6jb9fgv21zql616kcq5ypxj803wmisa-python3-3.12.13-env
J297_REGRESSION_MANIFEST=PRIVATE_CONTROL_MANIFEST
"$J297_BEFORE/bin/python" -P measure_archives.py --manifest "$J297_REGRESSION_MANIFEST" --sha PRIVATE_CONTROL_1 --sha PRIVATE_CONTROL_2 --sha PRIVATE_CONTROL_3 --sha PRIVATE_CONTROL_4 --sha PRIVATE_CONTROL_5 --sha PRIVATE_CONTROL_6
/nix/store/5hkdwc5mq2bxl6swbm11rvx6rd26kjd5-python3-3.12.13-env/bin/python -P measure_archives.py --manifest PRIVATE_TARGET_MANIFEST
/nix/store/5hkdwc5mq2bxl6swbm11rvx6rd26kjd5-python3-3.12.13-env/bin/python -P measure_archives.py --manifest PRIVATE_CONTROL_MANIFEST --sha PRIVATE_CONTROL_1 --sha PRIVATE_CONTROL_2 --sha PRIVATE_CONTROL_3 --sha PRIVATE_CONTROL_4 --sha PRIVATE_CONTROL_5 --sha PRIVATE_CONTROL_6The two cited unavailable inputs changed from |
|
Corpus decompilation diffs can be found at angr/dec-snapshots@master...angr/cle_851 |
a56e368 to
2591eed
Compare
|
Should we also send a PR to arpy? |
THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS
Problem
Some valid static archives use slash-newline entries in their GNU filename table and pad the table with NUL bytes. arpy selects NUL separation whenever any NUL occurs, so a later
/offsetmember fails withArchiveFormatError: file references a name not present in the index.The affected samples are unavailable. Their verified SHA-256 identifiers and observed changes are:
0e712c71b3a16c8431e0d99fc4f0a3989744de05296a1793af72fb089a59c432: failed before; loads as an AMD64StaticArchivewith 77 members after.4da54dd0ee922a62a3fdd17d0c0c08cd164a4a30f847bf4c2ef88c33fec49ff8: failed before; loads as an AMD64StaticArchivewith 2 members after.The exact inputs and reproducer are unavailable.
Root cause
arpy selects NUL separation whenever any NUL occurs in a GNU filename table. That misclassifies trailing padding as a delimiter and makes valid slash-newline entries after the first one unreachable by offset.
Fix
Recognize NULs as padding only when the unpadded table is unambiguously slash-newline-terminated. Continue to treat all other tables containing NULs as NUL-delimited, and populate both arpy's eager and lazy lookup fields.
Testing
The regression test uses an existing tracked GNU archive to cover ordinary long-name lookup without distributing unavailable bytes. Both affected campaign objects changed from the recorded
ArchiveFormatErrorto successful loads. 6 recorded-successStaticArchivecontrols spanning RISCV64, AMD64, X86, PPC64, PPC32, and AARCH64 retained identical backend, architecture, and member counts; 0 became worse.The four commands below were executed from the same private measurement directory. The confidentiality rule forbids publishing private paths and control identifiers, so
PRIVATE_TARGET_MANIFEST,PRIVATE_CONTROL_MANIFEST, andPRIVATE_CONTROL_1throughPRIVATE_CONTROL_6replace only those exact values. The command structure and every argument are otherwise unchanged.Validation: #851 (comment)
session: sharpen