diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-29 22:12:23 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-29 22:12:23 +0300 |
| commit | 9bd6ed5a7d40ff922a344ab636f804f1c9bb1f12 (patch) | |
| tree | d92709fc4dd84bd7b552793d53845448c81bce5c /internal/generate/classify_test.go | |
| parent | e08e4c166890889baa6ccd8da4086992298ab108 (diff) | |
test(generate): lock in munlock BPF handler wiring
Audit of munlock(2): int munlock(const void addr[.size], size_t size).
Verified the existing implementation is correct and consistent with its
mlock/mlock2 siblings:
- KindMem (classify.go) with addr=args[0], length=args[1]
- length2=0 and flags=0 (munlock has no flags, unlike mlock2's
MLOCK_ONFAULT at args[2]; distinct from munlockall which is KindNull)
- FamilyMemory (family.go)
- exit UNCLASSIFIED (returns int 0/-1, not a byte count)
- docs/syscall-tracing-plan.md already lists munlock under Memory + mem
No code or doc changes were needed; mage generate produces no diff.
Added a dedicated TestGenerateMemHandlerMunlock lock-in test mirroring
the madvise/mincore guards, asserting the correct arg mapping and the
absence of any flags/length2 wiring so a future copy of the mlock2
handler cannot silently surface a nonexistent args[2] as flags.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'internal/generate/classify_test.go')
0 files changed, 0 insertions, 0 deletions
