Complete STRA-8 comment carrier audit
Linux / verify (pull_request) Successful in 2m11s
Linux / changed-scope-coverage (pull_request) Skipped
Linux / keyless-cuda (pull_request) Skipped
Linux / hosted-cuda-package (pull_request) Skipped
Linux / linux-cli-container (pull_request) Successful in 1m35s
Linux / linux-static-cli (pull_request) Successful in 5m28s
Linux / release-cli (pull_request) Skipped

This commit is contained in:
Pavlo Ratushnyi
2026-10-07 06:33:59 +02:00
parent 845eb571ec
commit 161d779b7c
3 changed files with 5 additions and 7 deletions
+1 -1
View File
@@ -1442,7 +1442,7 @@ fn overlay_summary(
}
#[cfg(test)]
#[allow(clippy::items_after_test_module)] // comparison helpers remain grouped after this focused test module
#[allow(clippy::items_after_test_module)]
mod tests {
use super::*;
use std::sync::atomic::{AtomicU64, Ordering};
+3 -1
View File
@@ -21,6 +21,8 @@ use crate::kar;
#[cfg(test)]
static ARCHIVE_TEMP_SEQUENCE: AtomicU64 = AtomicU64::new(0);
const ARCHIVE_TEMP_SLOTS: u8 = 8;
#[cfg(unix)]
const POSIX_STICKY_BIT: u32 = 0o1000;
#[cfg(test)]
thread_local! {
@@ -306,7 +308,7 @@ fn validate_private_archive_parent_with(
return Err("KAR parent is not owned by the service or root".into());
}
let mode = metadata.mode();
let sticky = mode & 0o1000 != 0; // POSIX S_ISVTX is mode bit 01000.
let sticky = mode & POSIX_STICKY_BIT != 0;
if mode & 0o022 != 0 && !sticky {
return Err("KAR parent allows untrusted path replacement".into());
}
+1 -5
View File
@@ -964,10 +964,6 @@ fn require_streamed_space(
if archive_tensor_count == 0 || archive_tensor_count > 100_000 {
return Err("streamed sharded tensor count exceeds KAR-2 limits".into());
}
// Every nested part stores at least `levels` four-byte plane words per
// 32 values; a RAW fallback stores four bytes per value. The smaller of
// these is a safe lower bound before section files are created. Passing
// this gate does not guarantee enough space for scales and metadata.
let minimum_payload_bytes = archive_parts
.iter()
.flat_map(|parts| parts.iter())
@@ -3804,7 +3800,7 @@ mod tests {
}
#[test]
fn kar_payload_preflight_rejects_too_small_volumes_conservatively() {
fn minimum_payload_uses_plane_bytes_or_raw_fallback() {
assert_eq!(
minimum_part_payload_bytes(707_775_598_080, 2).unwrap(),
44_235_974_880