Repository navigation
fix(minimald): the ct-mark refusal for a whole-mark write under a packet-mark match names the match - #3702
Conversation
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.
|
Important Review skippedBot 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.
|
|
Approved: no findings at Nothing to do. Clobber: none seen. |
There was a problem hiding this comment.
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.
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.
|
Round 1 of 10 on the runtime's review findings, pushed as
Verify Review threads the coder judged:
On a host with Tailscale's nftables-mode 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. |
There was a problem hiding this comment.
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.
|
/review |
|
/revise |
…k-refusal-for-a-whole-mark-write-under
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.
|
Round 2 of 10 on a /revise note, pushed as
Verify 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. |
There was a problem hiding this comment.
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.
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.
|
Round 3 of 10 on the runtime's review findings, pushed as
Verify Review threads the coder judged:
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. |
There was a problem hiding this comment.
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.
…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.
|
Round 4 of 10 on the runtime's review findings, pushed as
Verify Review threads the coder judged:
On a host with Tailscale's nftables-mode 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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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).
|
/review |
There was a problem hiding this comment.
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.
Follow-up
Fixes #3693
scripts/install-host-classifier.shcrates/minimald/src/net/classifier.rsTask marker
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 saysThe rule in table ip mangle, chain OUTPUT matches the packet-mark bits 0x00ff0000, which Tailscale marks connections with.The final error no longer saysChange 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 & 0x00ff0000in install_decodes_masked_ct_mark_writes is unchanged and passes. Only the nftmeta mark & M [!=|==] Vmatch is recorded. An iptables-m mark --mark V/Mmatch 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
cargo test -p minimald install_refuses_tailscale_nft_mode_connmark_with_its_matchcargo test -p minimald install_refuses_tailscale_nft_mode_connmark_with_its_matchcargo test -p minimald install_refuses_a_whole_mark_ct_writerVerify
min task run agent-verifypassed ([tasks.verify]).