test(worker): verify child at the input caps, brk bounded by the limits

Max frame (document and base 2 MiB, drawings 6 MiB) passes through the full
sandbox; refusals just beyond give caps verdicts; RLIMIT_AS and the argument
filters still stop the verify child; seccomp traced on the max input; the two
tracked misclassifications asserted as current behaviour.
This commit is contained in:
bchanot committed 2026-11-01 21:07:23 +01:00
1 parent a6de7d6b94
commit e967ce6736
5 files changed
+385 -3

No files matched your search

+36
View File
@@ -344,6 +344,42 @@ fn rows_outside_the_policy_are_never_fetched() {
}
}
// Tracked misclassification (owner brief 2026-11-01), not fixed: an object larger than the
// policy is passed without bytes, so the core judges it missing (`drawing_missing`, listed
// after `caps`: the row's declared size already exceeds the cap) where `size_mismatch` would
// name it.
#[test]
fn tracked_an_object_over_the_policy_is_reported_drawing_missing() {
let mut too_big = row();
too_big.byte_size = VERIFY_MAX_DRAWING_BYTES as u64 + 1;
let fake = Fake::with_input(input(document().to_string(), vec![too_big]));
assert_eq!(process(&fake, &InProcess), VerifyEnd::Failed);
assert_eq!(fake.names(), ["input", "complete"]);
let verdict = fake.verdict();
assert_eq!(
verdict["failures"],
json!([verdict_codes::CAPS, verdict_codes::DRAWING_MISSING])
);
assert_eq!(verdict["drawings"][0]["result"], "missing");
}
// Tracked misclassification (owner brief 2026-11-01), not fixed: a document naming enough
// drawings that the frame header passes 64 KiB is refused by the parent's own framing and
// reported `resource_limit` (a worker failure, retried) where `caps` would name it.
#[test]
fn tracked_a_header_over_64_kib_is_reported_resource_limit() {
let rows = vec![row(); 600];
let fake = Fake::with_input(input(document().to_string(), rows));
assert_eq!(
process(&fake, &Fixed::never()),
VerifyEnd::Reported(codes::RESOURCE_LIMIT)
);
assert_eq!(
fake.calls().last().unwrap(),
&fail_call(codes::RESOURCE_LIMIT)
);
}
#[test]
fn downloads_stop_at_the_drawing_count() {
let rows = vec![row(); 6];