diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-30 10:31:04 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-30 10:31:04 +0300 |
| commit | 7595c52029ddd83bdcc48481528f2af7c4ccb1a0 (patch) | |
| tree | 27ef00932d563db5276c074850e996849d87381f /internal/generate/retclassify_test.go | |
| parent | d7ed10ef5f3d819c7232302317c8ba149922b391 (diff) | |
test(setpgid): lock in KindNull/Process/UNCLASSIFIED audit findings
Audit of setpgid(pid_t pid, pid_t pgid): both args are process/process-
group identifiers (kernel tracepoint type pid_t), never an fd or path;
the call returns int 0/-1. Verified it is correctly classified KindNull
(null_event), FamilyProcess, and UNCLASSIFIED ret, and that the Process
and null lists in docs/syscall-tracing-plan.md stay in sync. No
classification change was needed.
Add lock-in tests so a future stray reclassification trips immediately:
- TestClassifySetpgidNullEnter feeds the REAL tracepoint fields (pid_t
pid, pid_t pgid) and asserts KindNull, proving args[0] (pid) is never
mistaken for an fd: isFdType matches only int/unsigned int/unsigned
long (not pid_t) and the fd heuristic also requires field name fd.
- TestClassifyExitSetpgidUnclassifiedRet asserts the exit is KindRet and
ClassifyRet stays UNCLASSIFIED (status code, not a byte count).
- Add setpgid to the retclassify UNCLASSIFIED cluster beside setsid/getsid.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'internal/generate/retclassify_test.go')
| -rw-r--r-- | internal/generate/retclassify_test.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/generate/retclassify_test.go b/internal/generate/retclassify_test.go index c434b7d..2f53437 100644 --- a/internal/generate/retclassify_test.go +++ b/internal/generate/retclassify_test.go @@ -84,6 +84,12 @@ func TestClassifyRetUnclassified(t *testing.T) { // byte transfer. "setsid", "getsid", + // setpgid(2) sets the process group ID of a process and returns int + // 0 on success or -1 on error — a status code, not a transferred byte + // count. Its exit must stay UNCLASSIFIED (plain ret_event), exactly + // like its session/process-group siblings setsid/getsid above and the + // pid-returning getpid/getppid below. + "setpgid", "getpid", "getppid", } |
