Skip to content

sessions: a file's chunk is bounded by the reader's buffer, and the disk tier is owner-only - #3030

Merged
ashhart merged 2 commits into
mainfrom
security/session-disk-tier
Nov 13, 2026
Merged

ashhart merged 2 commits into
mainfrom
security/session-disk-tier

Conversation

@ashhart

@ashhart ashhart commented Nov 12, 2026

Copy link
Copy Markdown
Owner

What this changes

Before: a session file's header could name a chunk larger than the buffer it is read into, and on Linux the disk tier's files were created readable by other users. After: such a header is refused, entry files are created 0600 in 0700 folders, and opens do not follow links.

  • Issue: n/a. SECURITY.md asks for private reports, so there is no public issue.
  • Stacked on: main.
  • atc overlap --json: not run.

Checks on this head

  • Head commit: 5e178505f5be3b253060a61b93b58ed096c56fd5
  • Lean checker, python3 tools/zig/lean_check.py, on the base and on this head: 345 on the base, 345 on this head, 0 new.
  • Tests run, with the command and pass, fail and skip counts:
    • zig fmt --check on 3 files: passes
    • git diff --check: passes
    • zig build test-sessions check-sessions-linux test-sessions-writes-host: 8/8 steps succeeded; 28/31 tests passed (3 skipped)
    • zig build test-server-cpu: 5/5 steps succeeded; 1325/1332 tests passed (7 skipped)
    • zig build check-native-cuda-host compile-flashnext-mtp-parity-host compile-glm-native-open: 11/11 steps succeeded
    • zig build test-golden test-server-security test-pull-security: 76/76 steps succeeded; 32/32 tests passed
  • New tests:
    • security: a file whose chunk is larger than the reader's buffer is refused
  • CI: runs on this push.
  • Not run, and why: The chunk bound has a test. The permission change is compiled for Linux and was not run there. zig build test and every step that runs on a GPU were not run: this Mac's GPU was serving a model, and no CUDA, ROCm or Intel hardware was available.

Receipt

n/a. This change cannot reach inference: it is the session disk tier's file handling. The tier is off unless TF_DSV41_SESSION_DISK is set.

Checklist

  • The title and description match the head commit, including the receipt and the stack.
  • New tests fail before the change, pass after it, and skip cleanly without their dependency. Each new test was shown to fail without its fix on the earlier base b38a4dd02. On this base only the passing side was rerun.
  • Comments and docstrings are one line. No measurements or history in the source.
  • No personal data, machine names, internal hosts or local paths in the diff or its commits. No AI attribution lines.

Notes for the reviewer

  • Main already refuses the header's two overflowing sums. This adds the bound against the reader's buffer.

Suggested changelog line

Sessions: a file whose chunk is larger than the reader's buffer is refused, and the disk tier's files and folders are owner-only.

…isk tier is owner-only

A session file's header could name a chunk larger than the buffer it is read into. The header is now
refused. Entry files are created 0600 and their folders 0700, and opens do not follow links.
@ashhart
ashhart force-pushed the security/session-disk-tier branch from 5e17850 to 315bad7 Compare November 13, 2026 00:01
@ashhart
ashhart merged commit 1ae2213 into main Nov 13, 2026
2 of 10 checks passed
@ashhart
ashhart deleted the security/session-disk-tier branch November 13, 2026 00:01
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