Skip to content

docs(kernel-modules): align this_module statuses and trailer reason with the parser - #7758

Closed
ayobamiseun wants to merge 1 commit into
morluto:mainfrom
ayobamiseun:docs/7670-7669-kernel-module-guide
Closed

ayobamiseun wants to merge 1 commit into
morluto:mainfrom
ayobamiseun:docs/7670-7669-kernel-module-guide

Conversation

@ayobamiseun

@ayobamiseun ayobamiseun commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #7670. Fixes #7669. Two sentences in docs/kernel-modules.md disagree with what inspect_kernel_module actually returns:

This PR corrects the guide only. The parser, schema enum, and KernelModuleService consistency check are unchanged.

Problem and expected behavior

Change and scope

  • docs/kernel-modules.md this_module paragraph: list unsupported as the fourth status and state its condition (section stored SHF_COMPRESSED; file range reported; payload not inflated).
  • docs/kernel-modules.md trailer paragraph: reword so signature_trailer_truncated is 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

  • Semantic owner and earliest changed stage: docs/kernel-modules.md only. Owners of the facts (KernelModuleParser.ts, kernelModule.ts) are unchanged; the guide now repeats their enumerations instead of a narrower list.
  • Contribution scope fit and linked maintainer decision: documentation correction; not applicable.
  • CLI and MCP/tool-catalog contract: none.
  • Provider, bridge, target-format, or platform compatibility: none.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details: not applicable.
  • Generated metadata, package, or installation impact: none.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: none. grep -rn "signature_trailer_truncated" and grep -rn "present, absent, or unknown" over tests/, scripts/, src/, and docs/ 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.
  • Base reproduction or other evidence: source-derived. presence in src/native/elf/KernelModuleParser.ts returns { status: "unsupported", location } for section.compressed; thisModuleSchema.status is z.enum(["present", "absent", "unknown", "unsupported"]). parseSignature guards magic.offset < MODULE_SIGNATURE_INFO_BYTES (12) with a 28-byte magic, so the file must be under 40 bytes; readElfSectionDirectory in src/native/metadata/NativeSectionDirectory.ts requests the 52/64-byte header and rejects out-of-file reads, and src/domain/elfFixedHeader.ts applies the same minimum. The issues' CLI fixture runs (compressed section returns unsupported; no admitted fixture returns signature_trailer_truncated) were reported by the issue author; I did not re-run them.
  • User-visible CLI/MCP output: not applicable.
  • Remaining proof gaps: no runtime re-execution of the issue fixtures in this PR.

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' . (excluding node_modules, dist) — only docs/kernel-modules.md, KernelModuleParser.ts:437, KernelModuleService.ts:260, kernelModule.ts:84; no tests or doc checks.
  • Pre-push npm run check:fast (typecheck, lint) — passed.
  • npm run docs:check was not run for this branch: the change edits prose only, with no links or structure changes.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: none.

Author readiness

Human owner: @ayobamiseun

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🤖 Generated with Claude Code

@greptile-apps

greptile-apps Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] This documentation-only change appears safe to merge.

Summary

Updates docs/kernel-modules.md to match the parser:

  • The guide explains when this_module is unsupported.
  • The guide marks one trailer reason as unreachable for admitted files.

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.
@ayobamiseun
ayobamiseun force-pushed the docs/7670-7669-kernel-module-guide branch from 7cbf3bf to b472d49 Compare October 28, 2026 09:31
@ayobamiseun
ayobamiseun marked this pull request as ready for review October 28, 2026 19:30
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T19:33:32.570044Z b472d49 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

N0zoM1z0 pushed a commit that referenced this pull request Nov 14, 2026
…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]>
@N0zoM1z0

Copy link
Copy Markdown
Collaborator

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.

@N0zoM1z0 N0zoM1z0 closed this Nov 14, 2026
@morluto morluto added the documentation Improvements or additions to documentation label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

3 participants