8000 fix(minimald): the ct-mark refusal for a whole-mark write under a packet-mark match names the match by minimal-foundry[bot] · Pull Request #3702 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

fix(minimald): the ct-mark refusal for a whole-mark write under a packet-mark match names the match - #3702

Merged
mitodrummer merged 6 commits into
mainfrom
agent/3693-the-ct-mark-refusal-for-a-whole-mark-write-under
Nov 21, 2026
Merged

mitodrummer merged 6 commits into
mainfrom
agent/3693-the-ct-mark-refusal-for-a-whole-mark-write-under

Conversation

@minimal-foundry
Copy link
Copy Markdown
Contributor

Follow-up

Fixes #3693

Task marker
### D3693 — The ct-mark refusal for a whole-mark write under a packet-mark match names the match and does not tell the user to change a rule that another program manages
  kind: task
  size: S
  est: 60 code, 90 tests
  executor: agent
  origin: residual
  epic: 1437
  layers:
    - installer:
      - scripts/install-host-classifier.sh: In ct_mark_conflicts_in, record the packet-mark match (meta mark & M != V) of a whole-mark ct write. In the refusal, print that match and drop 'Change that rule' when a known owner or mark range applies.
      test: cargo test -p minimald install_refuses_tailscale_nft_mode_connmark_with_its_match
    - tests:
      - crates/minimald/src/net/classifier.rs: Add a fixture for Tailscale's nftables-mode mangle OUTPUT (ip and ip6). Add a test that the refusal names the packet-mark match and omits 'Change that rule'. Keep the verdict pin for meta mark & 0x00ff0000.
      test: cargo test -p minimald install_refuses_tailscale_nft_mode_connmark_with_its_match
      test: cargo test -p minimald install_refuses_a_whole_mark_ct_writer
  proof: On a host with Tailscale's nftables-mode rule ct state new meta mark & 0x00ff0000 != 0x00000000 ct mark set meta mark & 0x00ff0000, min finalize-install names the 0x00ff0000 packet-mark match and does not tell the user to change the rule.

Proof

On a host with Tailscale's nftables-mode rule ct state new meta mark & 0x00ff0000 != 0x00000000 ct mark set meta mark & 0x00ff0000, min finalize-install refuses. Each conflict line ends with (writes every bit of the connection mark, for packets that match meta mark & 0x00ff0000 != 0x00000000). A line then says The rule in table ip mangle, chain OUTPUT matches the packet-mark bits 0x00ff0000, which Tailscale marks connections with. The final error no longer says Change that rule. It says that the lines above name the program or the mark range, and to run min finalize-install again when the ruleset no longer has the rule.

Notes from the agent: The installer no longer says 'Change that rule' when a known program name (by table or chain) or a well-known mark range accounts for every whole-mark rule. The wg_quick rule in install_refuses_a_whole_mark_ct_writer has a known owner, so it now gets the new message. That test's assertion changed from 'then run min finalize-install again.' to 'run min finalize-install again.'. A whole-mark rule that no name or range accounts for still gets the old 'Change that rule ...' text, and the new test pins this. The verdict pin for meta mark & 0x00ff0000 in install_decodes_masked_ct_mark_writes is unchanged and passes. Only the nft meta mark & M [!=|==] V match is recorded. An iptables -m mark --mark V/M match is not. The root-integration test install_refuses_a_whole_mark_ct_writer (ignored here, run by just test-root-integration) was not run. A grep found no pin of the changed text outside the two files. I did not run just lint-prose or clippy-strict.

Tests

line exit tail
cargo test -p minimald install_refuses_tailscale_nft_mode_connmark_with_its_match 0 running 1 test test net::classifier::tests::install_refuses_tailscale_nft_mode_connmark_with_its_match ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1546 filtered out; finished in 0.24s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 13 filtered
cargo test -p minimald install_refuses_tailscale_nft_mode_connmark_with_its_match 0 running 1 test test net::classifier::tests::install_refuses_tailscale_nft_mode_connmark_with_its_match ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1546 filtered out; finished in 0.27s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 13 filtered
cargo test -p minimald install_refuses_a_whole_mark_ct_writer 0 running 1 test test net::classifier::tests::install_refuses_a_whole_mark_ct_writer ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1546 filtered out; finished in 0.59s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 13 filtered out; finished in 0. 8000 0

Verify

min task run agent-verify passed ([tasks.verify]).

The ct-mark scan now records the packet-mark match (meta mark & M != V)
of a rule that writes every bit of the connection mark. The refusal
prints that match, and names the well-known range its mask touches,
such as Tailscale's 0x00ff0000 in its nftables mode. When a known
program or mark range accounts for every such rule, the refusal no
longer tells the user to change the rule.
@coderabbitai
coderabbitai Bot commented Nov 20, 2026 •
Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

Ask an organization administrator to verify that this bot has an active assigned CodeRabbit review seat. See the seat-assignment guide. After the seat is confirmed, request a review again.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4d72d1de-eb92-424a-b08f-c6f803294590

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@minimal-foundry
minimal-foundry Bot commented Nov 20, 2026 •
Copy link
Copy Markdown
Contributor Author

Approved: no findings at 9ef5b5aa727a.

Nothing to do.

Clobber: none seen.

@minimal-arch minimal-arch 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.

arch-review: PASS · the full ruling

The design of record does not govern how the classifier install step reports a connection-mark conflict. Section 7.4 says only that the classifier is a one-time privileged install step. The change keeps every refusal, and every branch still exits with an error. Only the refusal text changes. The scan and its tests stay in the script and the module that own them. This is a pass by absence.

Ruled at cb89380 against gominimal/arch@4f2eb87d5d12 by claude-opus-5-5.

@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

minimal-review — advisory review

Verdict COMMENT — 1 finding, 1 inline.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

Comment thread scripts/install-host-classifier.sh Resolved
A packet-mark match whose mask has bits outside a well-known range
matched marks the range does not account for, yet the refusal named the
range and dropped 'Change that rule'. Require every mask bit inside the
range, and pin a 0xffffffff match as the user's rule to change.
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 1 of 10 on the runtime's review findings, pushed as 205376062385.

line exit tail
cargo test -p minimald install_refuses_tailscale_nft_mode_connmark_with_its_match 0 running 1 test test net::classifier::tests::install_refuses_tailscale_nft_mode_connmark_with_its_match ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1546 filtered out; finished in 0.38s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 13 filtered
cargo test -p minimald install_refuses_tailscale_nft_mode_connmark_with_its_match 0 running 1 test test net::classifier::tests::install_refuses_tailscale_nft_mode_connmark_with_its_match ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1546 filtered out; finished in 0.37s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 13 filtered
cargo test -p minimald install_refuses_a_whole_mark_ct_writer 0 running 1 test test net::classifier::tests::install_refuses_a_whole_mark_ct_writer ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1546 filtered out; finished in 0.74s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 13 filtered out; finished in 0.0

Verify min task run agent-verify passed.

Review threads the coder judged:

  • 👍 valid — scripts/install-host-classifier.sh:1664: range_of now names a range only when every bit of the match mask is inside it. A 0xffffffff match names no range and keeps 'Change that rule', and a new test pins that case. A mask such as 0x00010000 is inside 0x00ff0000 and still names Tailscale's range, because it matches only bits of that range.

On a host with Tailscale's nftables-mode rule ct state new meta mark & 0x00ff0000 != 0x00000000 ct mark set meta mark & 0x00ff0000, min finalize-install refuses. The refusal names the meta mark & 0x00ff0000 != 0x00000000 match and says the bits 0x00ff0000 are the range Tailscale marks connections with. It does not tell the user to change the rule. A match mask with bits outside every well-known range, such as 0xffffffff, names no range and still tells the user to change the rule.

Notes from the agent: Revise round 1: range_of now names a well-known range only when the match mask is non-zero and every one of its bits is inside the range. The unit test install_refuses_tailscale_nft_mode_connmark_with_its_match adds a case for a 0xffffffff match.

@minimal-arch minimal-arch 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.

arch-review: PASS · the full ruling

The design of record says nothing about the ct-mark conflict scan or the text of its refusal, so this is a PASS by absence. The new commit narrows range_of. A mark range is named only when the match mask is inside the range. This keeps the 'Change that rule' text for a wider mask. Both refusal branches still stop the install. The new test pins the wider-mask case.

Ruled at 2053760 against gominimal/arch@4f2eb87d5d12 by claude-opus-5-5.

@norrietaylor
Copy link
Copy Markdown
Member

/review

@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

minimal-review — approval withheld

Verdict COMMENT — APPROVE withheld: 1 unresolved thread — minimal-foundry[bot] scripts/install-host-classifier.sh. No findings.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

@norrietaylor
Copy link
Copy Markdown
Member

/revise
Fix the open minimal-review finding (MEDIUM, correctness) in scripts/install-host-classifier.sh, ct_mark_rule_owners / range_of: range_of returns a well-known range when the match mask shares any one bit with it. A rule that matches meta mark & 0xffffffff or & 0x00010000 from another program is then reported as matching Tailscale's 0x00ff0000 bits and not counted as unowned, so the refusal drops "Change that rule". Report a well-known range only when the match mask lies inside that range. Otherwise treat the rule as unowned and name its real mask. Add a fixture for a full-width mask and one for a one-bit mask outside the range. Keep the scan's verdict (the refusal) as it is; this task changes only the text and fixtures.

A packet-mark match on one bit outside every well-known range names no
range, and the refusal still tells the user to change the rule.
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 2 of 10 on a /revise note, pushed as ddee973a6627.

line exit tail
cargo test -p minimald install_refuses_tailscale_nft_mode_connmark_with_its_match 0 running 1 test test net::classifier::tests::install_refuses_tailscale_nft_mode_connmark_with_its_match ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1547 filtered out; finished in 0.43s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 13 filtered
cargo test -p minimald install_refuses_tailscale_nft_mode_connmark_with_its_match 0 running 1 test test net::classifier::tests::install_refuses_tailscale_nft_mode_connmark_with_its_match ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1547 filtered out; finished in 0.41s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 13 filtered
cargo test -p minimald install_refuses_a_whole_mark_ct_writer 0 running 1 test test net::classifier::tests::install_refuses_a_whole_mark_ct_writer ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1547 filtered out; finished in 0.59s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 13 filtered out; finished in 0.0

Verify min task run agent-verify passed.

On a host with Tailscale's nftables-mode rule ct state new meta mark & 0x00ff0000 != 0x00000000 ct mark set meta mark & 0x00ff0000, min finalize-install names the 0x00ff0000 packet-mark match and does not tell the user to change the rule. A rule from another program that matches meta mark & 0xffffffff or & 0x01000000 names no range, and the refusal still says 'Change that rule'.

Notes from the agent: The range_of fix (a range is named only when every bit of the match mask lies inside it) and the full-width 0xffffffff fixture were already on the branch in 2053760. This round adds the one-bit fixture outside every range (meta mark & 0x01000000) to install_refuses_a_whole_mark_ct_writer. The note's example 0x00010000 lies inside Tailscale's 0x00ff0000 range, so under the inside-the-range rule it still names Tailscale. The fixture uses 0x01000000, a one bit mask outside both ranges. The verdict (the refusal) is unchanged. The root-integration test install_refuses_a_whole_mark_ct_writer in tests/ is ignored here and runs on the native lane's root-integration job.

@minimal-arch minimal-arch 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.

arch-review: PASS · the full ruling

The only change since the last PASS is one new test case. It pins a one-bit mark match outside every well-known range as unowned. The refusal for that rule still tells the user to change it. The installer logic does not change. The classifier step stays where §4.1 puts it. The ruling at 2053760 stands for everything else.

Ruled at ddee973 against gominimal/arch@4f2eb87d5d12 by claude-opus-5-5.

@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

minimal-review — advisory review

Verdict COMMENT — 1 finding, 1 inline.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

Comment thread scripts/install-host-classifier.sh Resolved
The owner lines kept one line per table and chain, so a chain with a
ranged whole-mark rule and an unowned one named only the first. Key the
lines on the chain and its range as well.
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 3 of 10 on the runtime's review findings, pushed as 23727ba63fee.

line exit tail
cargo test -p minimald install_refuses_tailscale_nft_mode_connmark_with_its_match 0 running 1 test test net::classifier::tests::install_refuses_tailscale_nft_mode_connmark_with_its_match ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1547 filtered out; finished in 1.08s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 13 filtered
cargo test -p minimald install_refuses_tailscale_nft_mode_connmark_with_its_match 0 running 1 test test net::classifier::tests::install_refuses_tailscale_nft_mode_connmark_with_its_match ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1547 filtered out; finished in 0.96s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 13 filtered
cargo test -p minimald install_refuses_a_whole_mark_ct_writer 0 running 1 test test net::classifier::tests::install_refuses_a_whole_mark_ct_writer ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1547 filtered out; finished in 0.95s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 13 filtered out; finished in 0.0

Verify min task run agent-verify passed.

Review threads the coder judged:

  • 👍 valid — scripts/install-host-classifier.sh: The owner lines now key on the chain and its matched range, so a ranged rule and an unowned rule in one chain each get a line. A test pins this case.

On a host with Tailscale's nftables-mode rule ct state new meta mark & 0x00ff0000 != 0x00000000 ct mark set meta mark & 0x00ff0000, min finalize-install names the rule with its meta mark & 0x00ff0000 match, says those bits are the range Tailscale marks connections with, and does not say 'Change that rule'. When one chain holds a ranged rule and an unowned rule, the refusal now prints a line for each.

Notes from the agent: Revise round 3: the explanation pass in ct_mark_rule_owners now keys its lines on the table and chain plus the matched range when no name owns the chain. Before, it kept one line per chain. A named owner still prints one line per chain. The new case is in install_refuses_tailscale_nft_mode_connmark_with_its_match.

@minimal-arch minimal-arch 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.

arch-review: PASS · the full ruling

The compare to ddee973 changes only how ct_mark_rule_owners() deduplicates the explanation lines. Each rule in one chain now gets the line that explains it. The unowned pass still decides the refusal, so the install still fails closed. The design of record has no line on the ct-mark conflict scan or its text. This is a PASS by absence, the same as the earlier rulings on this PR.

Ruled at 23727ba against gominimal/arch@4f2eb87d5d12 by claude-opus-5-5.

@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

minimal-review — advisory review

Verdict COMMENT — 1 finding, 1 inline.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

Comment thread scripts/install-host-classifier.sh Resolved
…t does

Only the match mask ties the rule to the range. The line now says the
program can load the rule and states what a rule that another program
loads must do.
@minimal-foundry
Copy link
Copy Markdown
Contributor Author

Round 4 of 10 on the runtime's review findings, pushed as 9ef5b5aa727a.

line exit tail
cargo test -p minimald install_refuses_tailscale_nft_mode_connmark_with_its_match 0 running 1 test test net::classifier::tests::install_refuses_tailscale_nft_mode_connmark_with_its_match ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1547 filtered out; finished in 0.49s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 13 filtered
cargo test -p minimald install_refuses_tailscale_nft_mode_connmark_with_its_match 0 running 1 test test net::classifier::tests::install_refuses_tailscale_nft_mode_connmark_with_its_match ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1547 filtered out; finished in 0.54s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 13 filtered
cargo test -p minimald install_refuses_a_whole_mark_ct_writer 0 running 1 test test net::classifier::tests::install_refuses_a_whole_mark_ct_writer ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1547 filtered out; finished in 0.63s running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 13 filtered out; finished in 0.0

Verify min task run agent-verify passed.

Review threads the coder judged:

  • 👍 valid — scripts/install-host-classifier.sh:1673: The range line now says the program 'can load this rule', not that it marks with the rule's bits as owner. It also tells the user that a rule another program loads must write only the connection-mark bits it uses. 'Change that rule' stays out of the final refusal for a range match, because the task

On a host with Tailscale's nftables-mode rule ct state new meta mark & 0x00ff0000 != 0x00000000 ct mark set meta mark & 0x00ff0000, min finalize-install refuses. It names the 0x00ff0000 packet-mark match and says that Tailscale marks connections with these bits, so Tailscale can load the rule. It does not tell the user to change the rule.

Notes from the agent: Revise round 4. The line for a rule that only a mark range ties to a program now reads: 'The rule in matches the packet-mark bits . marks connections with these bits, so can load this rule. If another program loads it, that program must write only the connection-mark bits it uses.' The final refusal still leaves out 'Change that rule' when every whole-mark rule has a name or a range, as the task requires. The pins in install_refuses_tailscale_nft_mode_connmark_with_its_match follow the new wording.

@minimal-arch minimal-arch 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.

arch-review: PASS · the full ruling

The design of record says nothing about connection-mark conflicts or the text of the install refusal. This push changes only the line that explains a rule in a well-known mark range, and the tests that pin it. The install still refuses a rule that writes every bit of the connection mark. The new text claims only what the mask can prove. No condition is open.

Ruled at 9ef5b5a against gominimal/arch@4f2eb87d5d12 by claude-opus-5-5.

@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

minimal-review — approval withheld

Verdict COMMENT — APPROVE withheld: 3 unresolved threads — minimal-foundry[bot] scripts/install-host-classifier.sh, minimal-foundry[bot] scripts/install-host-classifier.sh, minimal-foundry[bot] scripts/install-host-classifier.sh:1674. No findings.

Panel: 3 of 3 personas ran (correctness, security, supply-chain).

@norrietaylor
Copy link
Copy Markdown
Member

/review

@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

minimal-review — approved

Verdict APPROVE — every review thread is resolved; @norrietaylor closed the last one. The review of 9ef5b5aa727a withheld this approval on the threads open then. Posted as a comment: the App cannot approve its own pull request; the check and the label carry it.

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Nov 21, 2026
@mitodrummer mitodrummer left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved.

@mitodrummer
mitodrummer added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit 7ff9a85 Nov 21, 2026
40 checks passed
@mitodrummer
mitodrummer deleted the agent/3693-the-ct-mark-refusal-for-a-whole-mark-write-under branch November 21, 2026 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review:approved minimal-review approved the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

finalize-install refuses deny-all egress beside Tailscale's nftables-mode connmark rule, and tells the user to change a rule tailscaled owns

2 participants

0