Skip to content

Harden CODEOWNERS, action pins, CodeQL wording, and tool argv - #264

Open
aien-spark wants to merge 8 commits into
mainfrom
cursor/security-hardening-baseline-0743
Open

aien-spark wants to merge 8 commits into
mainfrom
cursor/security-hardening-baseline-0743

Conversation

@aien-spark

@aien-spark aien-spark commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Purpose and scope

Security hardening from the 2026-11-01 read-only baseline. Drake approved this work. It does not touch the AGPL relicense, and it does not touch the drift workflow.

  1. .github/CODEOWNERS is the file GitHub reads. The two unknown team handles are gone. @drakestapleton is the only owner on every listed path. The GPU-core and IP-review teams can be re-added once they exist and have write access.
  2. actions/checkout and actions/upload-artifact in c3.yml, c4-streams.yml, and c5-sharing.yml are pinned to full commit SHAs. Those checkouts set persist-credentials: false.
  3. AGENTS.md says CodeQL is repository code scanning default setup (dynamic/github-code-scanning/codeql), not a workflow file in this tree.
  4. The zero-CUDA ldd and nm checks pass binary_path with fork/exec and an argv. The pipe is created with pipe2(..., O_CLOEXEC).
  5. The argv test creates its files with open at mode 0600 or 0700. The stub log path from ZERO_CUDA_ARGV_LOG goes through omega_path_copy before it is opened. That is the fix for the six high CodeQL alerts on 2e64052.

The CODEOWNERS activation is meant to pair with an admin ruleset change (require 1 approval plus code-owner review). Drake will make that ruleset change himself. This PR does not change repository settings or rulesets.

Owners check

GET /repos/aien-dev/CUDApp/codeowners/errors?ref=2e6405285aa8e706157adfe09d72a05a3539fff0 returned zero errors. af7e2ea does not change CODEOWNERS.

@drakestapleton is GitHub user 213298340 and has admin on this repo. @aien-dev/gpu-core-reviewers and @aien-dev/ip-review were removed. Creating those teams is an admin change and was not done here.

Action pins

  • actions/checkout tag v7.0.1 is commit 3d3c42e5aac5ba805825da76410c181273ba90b1.
  • actions/upload-artifact tags v7 and v7.0.2 are both commit cf430e030ddbb5b0abf93d22962f4752f3646cd9.

Evidence

Receipt path: evidence/SEC-HARDENING-20261102/README.md.

Fresh clone of b198cdf18a0787f74049aceaac01f25c6891a3f8. Head 2e64052 added only that receipt. Head af7e2ea902a89762a2dd6dc6104ad71f94e63390 changes the argv test's file creation. test-zero-cuda-tool-argv was re-run on that tree and printed test-zero-cuda-tool-argv: PASS, including PASS tmpdir removed. The full make test suite was not re-run for af7e2ea. The receipt file was not edited.

CUDAPP_MEM_RESERVE_MIB=0 for the fresh-clone run. MemTotal was 16387280 kB and MemAvailable was 5059312 kB. The source default stays 4096.

  • make -j4 test on b198cdf: PASS. Exit 0. Last line CUDA++ HOST TESTS PASS (73 targets).
  • make test-native-artifact on b198cdf: PASS. Exit 0. test_gpu_artifact_export: 47 checks, 0 failed.
  • make zero-cuda-gate on b198cdf: PASS. Exit 0.
  • build/hello_gpu --sim on b198cdf: PASS. Exit 0.
  • make doctor on b198cdf: PASS as the expected NOT READY result. Make exited 2.
  • python3 tools/figures/make_figures.py --check on b198cdf: PASS. Exit 0. figures current: 10.
  • make test-zero-cuda-tool-argv on af7e2ea: PASS.
  • Full make test on af7e2ea: NOT RUN locally. CI host-tests covers it.
  • GB10 hardware tests: NOT RUN.

Known pre-existing item

omega_blackwell_verify_zero_libcuda_linkage and omega_blackwell_verify_zero_cuda_symbols still default a NULL path to /proc/self/exe. After exec, that path is the ldd or nm process, not the caller. This PR does not change that default.

CI note

On 2e64052, CodeQL reported six high alerts in the new test files (world-writable fopen, a chmod race, and the env path). af7e2ea is the fix. Drift failed on 2e64052 for the reason already recorded in review 5731101114: it is the omega-mv r4 drift, not this edit. The drift workflow was not changed. native-x86-host was cancelled, not a failing test.

Open in Web Open in Cursor 

Sweep re-check (2026-11-04, DRA-130)

CI: only drift fails (https://github.com/aien-dev/CUDApp/actions/runs/41910535452/job/126856588983). GB10: NOT_RUN (not required for this change).

The drift FAIL (45 of ~920 GPU paths vs omega-mv d3d1b1bc7) is inherited from main. It clears when #266 merges.

cursoragent and others added 4 commits November 2, 2026 00:24
popen with an unquoted binary_path split on spaces and ran shell
metacharacters. fork and exec keep the path as one argument, and the
host test covers both.

Co-authored-by: aien-spark <aien@aienos.com>
Move the proposed owners file to the path GitHub reads. The two
aien-dev groups were not confirmed as teams with write access, so
their lines are unchanged. Enforcement still waits on Drake's ruleset.

Co-authored-by: aien-spark <aien@aienos.com>
checkout v7.0.1 is 3d3c42e5aac5ba805825da76410c181273ba90b1.
upload-artifact v7 and v7.0.2 are cf430e030ddbb5b0abf93d22962f4752f3646cd9.

Co-authored-by: aien-spark <aien@aienos.com>
The Actions list shows dynamic/github-code-scanning/codeql. There is
no CodeQL workflow under .github/workflows.

Co-authored-by: aien-spark <aien@aienos.com>
@aien-spark
aien-spark marked this pull request as ready for review November 2, 2026 00:46

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: medium. Approved: Cursor Security Agent completed with no findings that need human review, Cursor Bugbot was not running, and no approval policy requires extra review. The CODEOWNERS, action-pin, and argv changes stay within the medium-risk threshold.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@aien-spark aien-spark left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix first. content is mostly right; the owners file and the receipt aren't.

blockers

  • .github/CODEOWNERS:16-54 — GET /repos/aien-dev/CUDApp/codeowners/errors?ref=388e228 returns 30 Unknown owner errors: 24 for @aien-dev/gpu-core-reviewers (16-26, 28-29, 32-39, 42, 45-46), 6 for @aien-dev/ip-review (49-54). github drops them, so every path is effectively @drakestapleton-only. nothing goes ownerless, but docs/REVIEWING.md:3 calls this file activated and :22-23 requires a reviewer "in the owning group" that doesn't resolve. create the teams with write access, or take them out and say Drake is the owner until they exist. don't ship a file that has 30 errors.
  • receipt, docs/REVIEWING.md:12-13: no receipt path posted. the template also asks for a "new receipt path" (.github/PULL_REQUEST_TEMPLATE.md:7). the inline log is fine as content, and rev-parse = 388e228, but 1.3 asks for a path. commit it or post it.

not this pr, but red

  • drift is failing for every pr opened after omega-mv f9a9a40b (#995 train r4, merged 00:28Z). the same paths drift against current main 183fa4f (Makefile, blackwell_codegen*, gpu_q38_graph*, omega_numeric., bw_warp_sim, a few tests). omega_blackwell_submit.c is still on its baseline blob 5efba9c in omega, so this edit isn't the cause. main goes red on its next drift run until r4 is ported.
  • the branch is 37 behind main. rebase before merge.

checked, ok

  • argv change: same tools and args, same scan, same fail-open on a missing tool or non-zero exit (status was ignored before and still is), stderr → /dev/null, execvp PATH lookup = sh lookup, EINTR waitpid. it's stricter on spaced and metachar paths, and there's no 512-byte truncation. the test separates old from new (split path, ;, $(), nm printf injection) and it's in HOST_TESTS. 73 targets checks out without CUDAPP_OMC_HOST.
  • pins: checkout 3d3c42e5 = v7.0.1, upload-artifact cf430e03 = v7.0.2 (= v7). all 4 pinned SHAs in .github/workflows are on their action's main (checkout and sbom-action behind main; download- and upload-artifact identical). no tag-pinned uses: left anywhere.
  • codeql: AGENTS.md:78 matches. the workflow is dynamic/github-code-scanning/codeql and there's no codeql file or codeql-action use in .github/workflows.
  • GB10 NOT RUN is fine. no hardware claim, and REVIEWING.md:50-51 doesn't require one.
  • CODEOWNERS order is fine (last match wins, * first). it covers itself via /.github/ (:59).

nits

  • .github/CODEOWNERS:58 /docs/review/ is dead; that dir is gone at head.
  • src/omega_blackwell_submit.c:703 pipe() without O_CLOEXEC. use pipe2(O_CLOEXEC) like glibc popen so concurrent forks don't inherit the fd.
  • src/omega_blackwell_submit.c:739,766 the NULL default /proc/self/exe is resolved inside ldd/nm, so it audits the tool, not the caller (callers at :64-65, :203-204, :459-460). same before this pr, but the gate is meaningless on that path.
  • tests/zero_cuda_tool_argv_test.c:144 leaves /tmp/cudapp-argv-* behind.
  • c3.yml:18, c4-streams.yml:15, c5-sharing.yml:17: no persist-credentials: false, unlike every other workflow. nothing uploads .git, so this is low risk.
  • ampere-x86.yml:17,27,59 pinned with no version comment.

enforcement: ruleset 25770321 only blocks deletion and force-push, and classic protection is off. nothing here is enforced until Drake changes the ruleset. this review is from the author account, so it isn't the 1.4 non-author approval. cursor[bot]'s approval isn't the human owner review from section 2.

Comment thread tests/zero_cuda_tool_argv_test.c Fixed
Comment thread tests/zero_cuda_tool_argv_test.c Fixed
Comment thread tests/zero_cuda_tool_argv_test.c Fixed
Comment thread tests/zero_cuda_tool_argv_test.c Fixed
Comment thread tests/zero_cuda_tool_stub.c Fixed
Comment thread tests/zero_cuda_tool_stub.c Fixed
cursoragent and others added 3 commits November 2, 2026 00:59
GitHub reported the two aien-dev team handles as unknown owners, so
every listed path stays with @drakestapleton until those teams exist
and have write access. The pipe uses O_CLOEXEC, the argv test removes
its temp directory, and the C3, C4, and C5 checkouts do not persist
credentials.

Co-authored-by: aien-spark <aien@aienos.com>
The suite ran on that commit. This file was added afterwards and is
not an input to make. GB10 stays NOT RUN.

Co-authored-by: aien-spark <aien@aienos.com>
CodeQL reported fopen creating mode 0666, a chmod race on the copied
stub, and the stub opening ZERO_CUDA_ARGV_LOG straight from the
environment. New files are opened at 0600 or 0700, and the log path
goes through omega_path_copy first.

Co-authored-by: aien-spark <aien@aienos.com>
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.

3 participants