test code v1

This commit is contained in:
2026-08-13 10:44:59 +02:00
commit f3b1165f19
301 changed files with 37885 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
# Test Case: Extended Inode Size Above OFF_MAX
**Test ID**: TC151-extended-inode-off-max
## Objective
Rerun rejection of an extended inode with bit 63 set in `i_size` on the current
exact KLD, before open, read, mmap, or pager setup.
## Fixture
Use `images/extended-size-bit63.erofs`. Evidence asserts a 64-byte regular
inode, exact NID/offset, `i_size=0x8000000000000000`, valid CRC, and image hash.
Compile `read_probe` and `mmap_fault` natively in FreeBSD.
## Procedure
Mount the image, then run every acquisition twice:
```sh
./read_probe expect-error "$mnt/oversize.dat" 97
./read_probe expect-error "$mnt/oversize.dat" 97
set +e
truss -o /tmp/tc151-stat.truss stat "$mnt/oversize.dat"; stat_rc=$?
./mmap_fault "$mnt/oversize.dat" > /tmp/tc151-mmap1 2>&1; mmap1_rc=$?
./mmap_fault "$mnt/oversize.dat" > /tmp/tc151-mmap2 2>&1; mmap2_rc=$?
set -e
printf 'stat_rc=%d mmap_rc=%d,%d\n' "$stat_rc" "$mmap1_rc" "$mmap2_rc"
tail -20 /tmp/tc151-stat.truss
cat /tmp/tc151-mmap1 /tmp/tc151-mmap2
```
Record dmesg delta, remove outputs, unmount, detach, and unload the exact KLD
at the end of G1.
## Expected Results
- All direct opens and traced `stat` fail with errno 97 (`EINTEGRITY`).
- Both mmap helpers exit 1 at `open` with the same error; no fd reaches mmap or
pager setup.
- No negative pager size, trap, panic, stale vnode, or cleanup residue occurs.
- Historical TC151 output cannot substitute for this current-KLD rerun.