Skip to content

build01: ask the stack-protector question of the stack-protector switch - #17

Merged
hongdy22 merged 1 commit into
mainfrom
fix/build01-ssp-switch-detection
Sep 14, 2026
Merged

hongdy22 merged 1 commit into
mainfrom
fix/build01-ssp-switch-detection

Conversation

@hongdy22

@hongdy22 hongdy22 commented Sep 14, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #12.

feature_switch() matched any pattern against a name-sorted cache, so feature_switch(r"SSP", r"STACK") answered with SODIUM_ACCEPTS_NOEXECSTACK — a probe about the assembler, sorting before SODIUM_USE_SSP and matching the broad pattern. The check then graded a variable that never controlled the stack protector.

  • Patterns are tried in order, the rule the Autotools branch beside it already followed.
  • Cache entries CMake marks INTERNAL or STATIC are skipped: a capability probe is not a control anyone can set.
  • The call site narrows STACK to STACK_?PROTECT.

No submission's option name is written down anywhere.

Also dropped: srb_skip_ok on this check. Narrowing the pattern makes None a likelier answer, so without this the fix would swap a wrong failure for a skip — which is charged and does not pass, and costs the stage all the same. That charge is the published rule, in scores_raw/LEGEND.md: "skip 进分母算 0:别的模型能跑出产物、这个模型跳过了,那是它自己的问题". It holds with no exception — 313 skipped checks on 42 cells across the published tables, all 42 scoring 0.

This check belongs on that side. §1.10 lists -fstack-protector as "overridable, the way --disable-ssp was" and offers no exemption; State A answers it, since --disable-ssp is in configure --help; and models answer it — it is every one of build01's hardening skips (7 cells published) and reads 12 pass and 3 fail beside them. Only the wording changes: the record now says the contract required the switch instead of calling its absence permitted.

Regression: infra/tests/test_build01_feature_switch.py, 14 checks against caches on disk — five spellings a port might choose, None for a probe-only cache, and the report reproduced with the original (SSP, STACK) patterns. Fails on main (3 of 14). The seven infra suites stay at 556 passed.

§1.10 does not say what the port must call its replacement for
`--disable-ssp`, so `feature_switch()` looks the name up rather than assuming
it.  It matched any pattern against a name-sorted cache, so
`feature_switch(r"SSP", r"STACK")` answered with SODIUM_ACCEPTS_NOEXECSTACK:
a probe recording whether the assembler takes `--noexecstack`, which sorts
before SODIUM_USE_SSP and matches the broad pattern.  The check then turned
that off, found `-fstack-protector` still on every compile line, and reported
that SSP could not be disabled -- about a variable that never controlled it.

Patterns are now tried in order, which is the rule the Autotools branch beside
it already followed, and cache entries CMake marks INTERNAL or STATIC are
skipped: a capability probe is not something anyone configuring the build can
set, so it cannot be the control §1.10 asks for.  The call site's second
pattern narrows from `STACK` to `STACK_?PROTECT`, which describes one flag
instead of two.

`srb_skip_ok` goes with it.  Narrowing the pattern made `None` -- no such
control anywhere in the cache -- a likelier answer, and a skip is charged and
does not pass, so without this the fix would have moved that port from a wrong
failure to a right one that still costs the stage.  The line `pytest_module`
draws is whether the reference can answer: State A's `configure --help` has
`--disable-ssp`, and across the preserved cells this row reads 12 pass and 3
fail beside its skips.  It is a question submissions answer, so the record now
says the contract does not permit the omission instead of calling it permitted.

No submission's variable name is written down anywhere: the regression test
runs five spellings a port might choose, and the case that reproduces the
report passes the original `(SSP, STACK)` patterns.
@hongdy22
hongdy22 force-pushed the fix/build01-ssp-switch-detection branch from a40e1cd to 23c65a7 Compare September 14, 2026 06:19
@hongdy22
hongdy22 merged commit ac78fe0 into main Sep 14, 2026
5 checks passed
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.

build01: SSP switch detection can select NOEXECSTACK capability variables

1 participant