summaryrefslogtreecommitdiff
path: root/internal/generate/retclassify_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-05-29 17:43:54 +0300
committerPaul Buetow <paul@buetow.org>2026-05-29 17:43:54 +0300
commitff9b210cb39e6ae72b43fb0814f32d6a39f77b63 (patch)
tree652bae2c31b537162adb1e2165e56b2fb192b116 /internal/generate/retclassify_test.go
parent0a9a92e359e06df0c6cd8e8eff1c165ed7fc2fa0 (diff)
test(generate): lock in setsid classification audit
setsid(2) takes no arguments and returns the new session ID (a pid_t) on success or (pid_t)-1 on error. Audit confirms it is correctly classified as KindNull (null_event enter handler, captures nothing), FamilyProcess (alongside its session/process-group siblings getsid/setpgid/getpgid/getpgrp and the pid-returning getpid/getppid), and its exit ret_type stays UNCLASSIFIED so the session-id return is never mistaken for a transferred byte count. No codegen or doc changes were required (mage generate yields no diff). Add lock-in assertions so a stray reclassification trips a test: - family_test.go: setsid + session/pgrp/pid siblings -> FamilyProcess - retclassify_test.go: setsid + pid-returning siblings -> Unclassified 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.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/generate/retclassify_test.go b/internal/generate/retclassify_test.go
index 148c1e6..4e6a0ad 100644
--- a/internal/generate/retclassify_test.go
+++ b/internal/generate/retclassify_test.go
@@ -60,6 +60,16 @@ func TestClassifyRetUnclassified(t *testing.T) {
// ret_event and must stay UNCLASSIFIED, like its NUMA siblings
// set_mempolicy/mbind/migrate_pages/move_pages.
"set_mempolicy_home_node",
+ // setsid(2) returns the new session ID (a pid_t) on success, or
+ // (pid_t)-1 on error; that return is a session/process identifier, not a
+ // transferred byte count. Its exit must stay UNCLASSIFIED (plain
+ // ret_event), exactly like its pid-returning siblings getsid/getpid/
+ // getppid (asserted below), so it is never mistaken for a read/write
+ // byte transfer.
+ "setsid",
+ "getsid",
+ "getpid",
+ "getppid",
}
for _, name := range unclassified {
if got := ClassifyRet("sys_exit_" + name); got != Unclassified {