Skip to content

fix(uat): close the /proc stat files the process probes read - #18

Merged
unohee merged 1 commit into
masterfrom
fix/codeql-procs-close
Oct 26, 2026
Merged

unohee merged 1 commit into
masterfrom
fix/codeql-procs-close

Conversation

@unohee

@unohee unohee commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

CodeQL pre-release audit (python-security-and-quality, 277 files) found two unclosed /proc/<pid>/stat reads in uat/procs.py. Fixed with with. Unit tests: pytest -k 'uat or procs' 84 passed, 4 skipped.

Triage of the remaining 181 results (noise unless noted):

  • real/low: dead assignments in cdp_guard.py, uat/batch.py.
  • structural, follow-up: py/unsafe-cyclic-import in native/context.py (22) and native/page.py (1). Works today; import order is fragile.
  • noise: py/illegal-raise (GuardLost is an Exception), py/call/wrong-named-argument (name resolution), test/probe scripts (fixture secret in gate output, header echo in fixtures, TLSv1 in probe).

_members and _running opened /proc/<pid>/stat without closing it; CodeQL
py/file-not-closed flagged both. CPython closes them when the reference
drops, so this is hygiene rather than a leak in practice, but the probes
run in a loop over every process on the machine.

CodeQL (python-security-and-quality, run on 0.2.0 candidate, 277 files)
triaged as [real 3 / noise rest]: this file, the dead assignments in
cdp_guard.py and uat/batch.py, and an import cycle in native/ that is
safe today and is logged for follow-up rather than changed here.
@unohee
unohee merged commit b265d58 into master Oct 26, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant