# Permission Lifetime Evidence

Native Linux evidence supplement for the existing Hesela ACL restore analysis.
Scope/coordination: https://github.com/hesela/hesela-seo/issues/3729

## Reproduce

Requirements: Linux, an unprivileged account with no effective capabilities,
Python 3, a C11 compiler named cc, findmnt, readable /proc/self/fd, an executable
build directory and writable test directories. The observed mounts were ext4
and tmpfs. Root execution is rejected, not automatically downgraded.

Run from this directory, using a new output filename:

```sh
python3 run.py --directory . --directory /dev/shm --repetitions 3 --output my-observations.json
python3 -m unittest -v test_run.py
python3 -O -m unittest -v test_run.py
```

The unit suite checks retained evidence and also executes 36 fresh native cases.
Each full collection executes 9 scenarios x 2 mounts x 2 compiler builds x 3
repetitions = 108 cases. observations-final.json and observations-replay.json
are separate captures, not two independent hosts. There are no confidence
intervals or incidence estimates because this is a deterministic mechanism
experiment on one environment.

## Files

- probe.c: original native syscall harness; no dependency on Python mmap behavior.
- run.py: bounded compilation, fixture lifecycle, provenance and strict expected-result checking.
- observations-final.json and observations-replay.json: complete native results.
- summary.json: derived summary and nine representative recorded rows.
- test_run.py: positive, mutation-negative and fresh native replay tests.
- sources.json and source-receipts.json: primary claim locators and retrieval hashes.
- synthesis.md: English publication-ready research narrative, subject to review.
- claims.json: typed evidence/interpretation/inference statements and corpus mapping.
- integration.md: exact existing-site insertion guidance, without duplicate pages.
- manifest.json: SHA-256 integrity inventory; hashes do not constitute independent review.
- finalize.py: derived summary and bounded primary-source receipt generation.

Only private temporary directories and exclusive new files are used. The fixture
builder rejects an existing path. Native descriptors and mappings close on normal
exit; each subprocess exit releases its remaining resources on failure. Fixture
directories are cleaned by the driver. No sockets, mounts, user switching or
production permissions are changed.

## Observation Encoding

For operation fields, 0 records success, a positive integer records Linux errno,
and -1 means the operation was not exercised in that scenario. Mapping stores
have no syscall return value; their success is checked by the mapped byte and
subsequent fresh readback. EACCES is 13 and EBADF is 9 in the retained environment.

## Limits

Same owner, no named-user ACL impersonation, no concurrent process, no NFS/SMB,
no mount remount, no LSM policy change, no crash/power-loss test. Readback establishes
visibility, not durability. Read synthesis.md before reusing a single table row.

## Licensing

Original source code in this directory is MIT-licensed; see LICENSE.
Hesela's observation JSON and claim records are released under CC0-1.0.
Narrative text follows the repository's publication policy. Third-party source
pages are linked and hashed, not copied or relicensed.
