Repository navigation
docs(kernel-modules): align this_module statuses and trailer reason with the parser - #7758
ayobamiseun wants to merge 1 commit into
Conversation
[Low impact] This documentation-only change appears safe to merge. SummaryUpdates
No actionable issues or security concerns found. Checks were source-based; no runtime tests ran. GitHub access was unavailable, so whether another PR supersedes this one could not be checked. Reviews (2) · Last reviewed commit: "docs(kernel-modules): align this_module ..." · Reviewed by Greptile |
…ith the parser The guide listed three `.gnu.linkonce.this_module` statuses, but the parser and the domain schema also return `unsupported` when the section is stored SHF_COMPRESSED. Add that status with its condition. The guide also presented `signature_trailer_truncated` as the result for an appended magic with fewer than 12 preceding bytes. That branch needs a file shorter than 40 bytes, and ELF admission requires at least 52 (ELF32) or 64 (ELF64) bytes, so the supported inspection never returns it. State that the reason is reserved and unreachable for admitted files without changing the parser or the schema enum.
7cbf3bf to
b472d49
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…ith the parser The guide listed three `.gnu.linkonce.this_module` statuses, but the parser and the domain schema also return `unsupported` when the section is stored SHF_COMPRESSED. Add that status with its condition. The guide also presented `signature_trailer_truncated` as the result for an appended magic with fewer than 12 preceding bytes. That branch needs a file shorter than 40 bytes, and ELF admission requires at least 52 (ELF32) or 64 (ELF64) bytes, so the supported inspection never returns it. State that the reason is reserved and unreachable for admitted files without changing the parser or the schema enum. Fixes #7669 Fixes #7670 Supersedes #7758 Co-Authored-By: gensokyo-dev <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks! This landed on main in #10490 as its own commit, cherry-picked with your authorship kept (rebase merge). Closing in favor of that merge. |
Summary
Fixes #7670. Fixes #7669. Two sentences in
docs/kernel-modules.mddisagree with whatinspect_kernel_moduleactually returns:.gnu.linkonce.this_moduleaspresent,absent, orunknown, but the parser (src/native/elf/KernelModuleParser.ts,presence) and the output schema (src/domain/native/kernelModule.ts,thisModuleSchema.status) also returnunsupportedwhen the section is storedSHF_COMPRESSED([Bug] Kernel-module guide omits the unsupported status for compressed this_module sections #7669).signature_trailer_truncatedas the result for an appended magic with fewer than 12 preceding bytes. That branch requires a file shorter than 40 bytes, while ELF admission requires at least 52 (ELF32) or 64 (ELF64) bytes, so the supported inspection never returns it ([Bug] Kernel-module guide lists a trailer-truncation reason no admitted ELF can produce #7670).This PR corrects the guide only. The parser, schema enum, and
KernelModuleServiceconsistency check are unchanged.Problem and expected behavior
.gnu.linkonce.this_modulehasSHF_COMPRESSED; the CLI returnsthis_module.status: "unsupported"with the stored file range, a value the guide did not list. Expected: the guide's status list matches the schema enum and says what selectsunsupported.parseSignaturereturnssignature_trailer_truncatedonly whenmagic.offset < 12, i.e. the whole file is under 40 bytes, but any file that reachesparseSignaturehas already passed ELF header admission (minimum 52/64 bytes). Expected: the guide does not advertise an unreachable reason while keeping the documented reason list consistent with the schema enum.Change and scope
docs/kernel-modules.mdthis_module paragraph: listunsupportedas the fourth status and state its condition (section storedSHF_COMPRESSED; file range reported; payload not inflated).docs/kernel-modules.mdtrailer paragraph: reword sosignature_trailer_truncatedis described as reserved for an appended magic with fewer than 12 preceding bytes and never returned for an admitted ELF file, then reflow the following sentences of the same paragraph (no wording change to them).Intentionally not included: removing the reason from the schema or the parser. The enum is part of the output contract and the parser's defensive branch costs nothing; narrowing the contract is a separate decision. The neighbouring "27-byte magic" wording (#7324 / #7491) is out of scope here.
Maintainer scope decision: not applicable (documentation correction).
Contract and boundary impact
docs/kernel-modules.mdonly. Owners of the facts (KernelModuleParser.ts,kernelModule.ts) are unchanged; the guide now repeats their enumerations instead of a narrower list.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
grep -rn "signature_trailer_truncated"andgrep -rn "present, absent, or unknown"overtests/,scripts/,src/, anddocs/show no test or doc check asserting on either sentence; the only other hits are the parser branch, the schema enum, and the service consistency check, all unchanged.presenceinsrc/native/elf/KernelModuleParser.tsreturns{ status: "unsupported", location }forsection.compressed;thisModuleSchema.statusisz.enum(["present", "absent", "unknown", "unsupported"]).parseSignatureguardsmagic.offset < MODULE_SIGNATURE_INFO_BYTES(12) with a 28-byte magic, so the file must be under 40 bytes;readElfSectionDirectoryinsrc/native/metadata/NativeSectionDirectory.tsrequests the 52/64-byte header and rejects out-of-file reads, andsrc/domain/elfFixedHeader.tsapplies the same minimum. The issues' CLI fixture runs (compressed section returnsunsupported; no admitted fixture returnssignature_trailer_truncated) were reported by the issue author; I did not re-run them.Validation performed
grep -n "present, absent, or unknown" docs/kernel-modules.md— before: line 53; after: no match.grep -n "signature_trailer_truncated" docs/kernel-modules.md— before: line 95 ("An appended magic with fewer than 12 preceding bytes is ..."); after: line 96, the reserved/unreachable sentence.grep -rn "signature_trailer_truncated" --include='*.ts' --include='*.mjs' --include='*.md' .(excludingnode_modules,dist) — onlydocs/kernel-modules.md,KernelModuleParser.ts:437,KernelModuleService.ts:260,kernelModule.ts:84; no tests or doc checks.npm run check:fast(typecheck, lint) — passed.npm run docs:checkwas not run for this branch: the change edits prose only, with no links or structure changes.Compatibility, safety, and release
Author readiness
Human owner: @ayobamiseun
Before merge
type(scope): outcome.🤖 Generated with Claude Code