Skip to content

feat(elf): report a Linux kernel image's version banner and embedded build config - #9573

Merged
morluto merged 15 commits into
morluto:mainfrom
mvanhorn:fix/linux-kernel-build-config
Nov 9, 2026
Merged

morluto merged 15 commits into
morluto:mainfrom
mvanhorn:fix/linux-kernel-build-config

Conversation

@mvanhorn

@mvanhorn mvanhorn commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

When triaging a Linux kernel image or firmware dump, the first questions are usually which kernel version it is and how it was configured (SELinux, module signing, debug options). The answers sit in the Linux version banner and, when the kernel was built with CONFIG_IKCONFIG, in the gzip .config framed by IKCFG_ST and IKCFG_ED. Getting them today means a Linux host and scripts/extract-ikconfig, or a booted system's /proc/config.gz.

This adds inspect_kernel_build_config (CLI inspect-kernel-build-config). It reads one local vmlinux ELF, raw arm64 Image, x86 bzImage/zImage with a gzip payload, or configs.ko module, and reports the banner and the parsed config options, with an optional exact name filter and paging. No issue is linked. This is a proposed new read-only capability.

Problem and expected behavior

Use case: an analyst has a kernel image from a device or distribution package and wants its version and selected config options without booting it or using a Linux host.

Observable outcome:

  • banner reports the Linux version string with version, builder and compiler split out, or absent/unknown for what was searched.
  • config is present only for a complete, CRC-checked gzip member framed by IKCFG_ST and IKCFG_ED whose text is .config grammar. Each option has a name, a kind (y, m, number, string, not_set) and a value, with option_count, matched_count and the requested page.
  • A bzImage gzip payload is inflated within its own budget and searched, with locations reported in the inflated payload's own offset space. Other codecs, and whole-file compressed streams such as Image.gz, are unsupported with the codec named.
  • Framed but broken blobs, including a framed member whose deflate stream is damaged or cut off by IKCFG_ED and a member whose FHCRC header checksum fails, are malformed, cut-off members are incomplete, and decoys that use up the search budget give config_search_exhausted. None of these is reported as an absent config.

Change and scope

Parsing lives in src/native/elf/KernelBuildConfig.ts, with the report schema in src/domain/native/kernelBuildConfig.ts. The compression-magic detection the kernel module parser already had moves into src/native/elf/KernelCompressionCodec.ts, so both readers share it. KernelModuleParser.ts changes only to import it. The tool is registered through the existing binary-diagnostics composition, CLI command table, capability declarations and MCP server, like the other native inspection tools. Docs: a new docs/guides/native/kernel-build-config.md guide with nav and index entries, a spec under docs/specs/native/kernel-build-config/, and lines in the authored skill reference.

Bounded by default: the file is limited by max_file_bytes (64 MiB, 512 MiB max), an IKCFG member to 4 MiB of output, a bzImage payload to 128 MiB, 16384 options and 256 entries per page. One search tries at most 16 candidates and inflates at most four times max_config_bytes across them. Each candidate's inflate input ends at its closing IKCFG_ED. Parsing is asynchronous: inflation runs on the zlib thread pool and the scans yield once per MiB, so a cancellation raised during parsing is observed. String values have no length cap beyond max_config_bytes, as in Kconfig.

Not included: decompressing xz, lz4, lzma, zstd, bzip2 or lzo payloads, comparing the config with a source tree, or evaluating Kconfig dependencies.

Follow the contribution scope.
Unresolved scope, authority, side effects, or required verification block
integration. Link the required maintainer scope decision for new providers or
capabilities involving target execution, injection, mutation, or protection
recovery; ordinary fixes within existing boundaries may state "not applicable".
Draft PRs may leave the scope decision pending and the readiness and merge checklists
unchecked. Maintainers can help resolve open questions.

Contract and boundary impact

  • Semantic owner and earliest changed stage: new kernel build config parser in src/native/elf/ and report schema in src/domain/native/, exposed through the binary-diagnostics service. Shared codec detection is extracted from the existing kernel module parser.
  • Contribution scope fit and linked maintainer decision: read-only inspection of one local file the caller selected, with no target execution, injection, mutation or protection recovery. Not applicable as a required decision. Whether REA wants this tool is for maintainers to judge, and I have not assumed approval.
  • CLI and MCP/tool-catalog contract: additive. New inspect-kernel-build-config command and inspect_kernel_build_config tool. The MCP input requires an absolute path, matching the other local path tools.
  • Provider, bridge, target-format, or platform compatibility: no external provider or bridge. Pure byte parsing with Node's zlib on any host.
  • Evidence, artifact, provenance, or reconstruction contract: new kernel-build-config normalized result. Banner text and config values are marked as target-derived and untrusted. Locations name their offset space (file or inflated_payload).
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): uses the existing stable artifact read. No retained resources.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs and skills/; edit authored instructions in .agents/skills/reverse-engineer-anything/ and never commit build outputs): authored skill reference lines, the new guide and its nav and index entries, and the spec. No build output is committed. The ## Native entry in docs/specs/README.md may conflict textually with my other open native-spec PRs; the entries are independent.

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: parser tests in src/native/elf/KernelBuildConfig.test.ts (decoys, budgets, truncation, bzImage payloads, cancellation), schema tests, service tests, a filesystem boundary test, an MCP boundary test, a CLI acceptance test, and the shared codec and module parser tests.
  • Base reproduction or other evidence: on main there is no command that reads a kernel banner or embedded config. On this commit I ran node scripts/rea.mjs inspect-kernel-build-config <file> --name CONFIG_SECURITY_SELINUX --json on Alpine's linux-virt 6.12.115-r0 x86_64 package, which is built with CONFIG_IKCONFIG=m:
    • boot/vmlinuz-virt (bzImage): the gzip payload at file offset 17092 (11,761,928 bytes) inflates to 39,203,748 bytes. The banner is present with version 6.12.115-0-virt and builder buildozer@build-3-22-x86_64. The config is absent with complete coverage, as expected for CONFIG_IKCONFIG=m.
    • lib/modules/6.12.115-0-virt/kernel/kernel/configs.ko: the config is present with 4707 options. That equals the CONFIG_*= and # CONFIG_* is not set lines in the package's own boot/config-6.12.115-0-virt, and the reported sha256 (d8c7cf26...7683) equals the sha256 of that shipped file. CONFIG_SECURITY_SELINUX comes back as not_set, matching that file.
  • User-visible CLI/MCP output (if applicable): summarized from the --json result for configs.ko with --name CONFIG_SECURITY_SELINUX.
{
  "banner": { "status": "absent" },
  "payload": { "container": "file", "status": "uncompressed" },
  "config": {
    "status": "present",
    "option_count": 4707,
    "matched_count": 1,
    "sha256": "d8c7cf26a199df3d39df4c97ff033f6553bc0d5ea529fe82e07cfe9b30e37683",
    "entries": [
      { "name": "CONFIG_SECURITY_SELINUX", "kind": "not_set", "value": null, "trust": "target-derived-untrusted" }
    ]
  },
  "coverage": { "status": "complete", "examined_bytes": 43863, "examined_entries": 4707 }
}
  • Remaining proof gaps: macOS host only, against one x86-64 distribution kernel. No arm64 Image, vmlinux ELF with CONFIG_IKCONFIG=y, or device firmware kernel was tested against real output; those paths are covered by synthetic fixtures. The real-kernel check is not committed as a script.

For boundary fixes, identify the applicable boundary regressions
and lifecycle regressions
covered by the evidence above, and explain relevant gaps.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • Latest review follow-up: 35 kernel-config source tests and check:fast passed. Validation uses constructed artifacts; no real-target/provider verification was run for this follow-up.

  • Long kernel config names: npm run test:local -- src/native/elf/KernelBuildConfig.test.ts src/application/binaryDiagnostics/KernelBuildConfigService.test.ts src/domain/native/kernelBuildConfig.test.ts passed (51 tests), and npm run check:fast passed. Synthetic long disabled and assigned names failed before the fix and pass after it; real-kernel verification was not performed.

Run on this commit on macOS with Node 24.22.1:

  • npx --no-install vitest run on the ten changed test files: 247 passed.
  • The Alpine kernel check described above.

Compatibility, safety, and release

  • Breaking changes or migration steps: none. New command and tool only. The kernel module parser's codec detection is moved, not changed.
  • Real disassembler, browser, or OS coverage: none needed. A real Alpine kernel package, inspected on macOS.
  • Package or release metadata impact: none. No new dependency or script.
  • Security, privacy, process, or containment review: the image is never executed or booted. Inflation is bounded per member, per payload and per search, each member's input is bounded by its closing marker, and target-derived strings are marked untrusted.

Author readiness

Human owner: @mvanhorn

  • 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.

AI was used for assistance.

…build config

inspect_kernel_build_config and inspect-kernel-build-config read one
local vmlinux, raw arm64 Image, gzip bzImage or zImage, or configs.ko
and report its Linux version banner and the IKCONFIG .config embedded
between IKCFG_ST and IKCFG_ED, without executing it. A config is present
only when a gzip member ends exactly at IKCFG_ED, passes its CRC-32 and
ISIZE checks and parses as .config text; framing that fails is reported
malformed, never absent. bzImage gzip payloads are inflated within a
budget and other codecs are named as unsupported, using codec detection
now shared with the kernel module parser. The config search, inflate
sizes and option counts are bounded, scans honor cancellation, and
target-derived text is marked untrusted.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T13:48:08.952693Z 3b7a588 New commits
ℹ️ 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.

@greptile-apps

greptile-apps Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5 Tier: plus

[Medium impact] The PR adds kernel-image inspection to the CLI and MCP for caller-selected local files.

The reviewed snapshot still needs the custom-version fix and corrected input-bound documentation before merging.

Findings

  1. P1 Custom kernel versions are shortened ▶
  2. P2 Guide promises outdated read bounds ▶
Fix with agent prompt
### Issue 1
src/native/elf/KernelBuildConfig.ts:undefined-526
`parseBannerText` cuts a release token at characters such as `@` or `:`. For `Linux version 6.6.0@vendor (builder@host) (gcc) #1`, it reports `version: "6.6.0"` and loses both `builder` and `compiler`. Custom kernel release suffixes can contain these characters, so analysts receive incomplete build details even though the full banner was found.

Read the full version token before splitting the following groups, and update `bannerAgrees` to accept the same token.

### Issue 2
docs/guides/native/kernel-build-config.md:44-45
The guide still says inflation stops at the first `IKCFG_ED`, but the latest change passes the remaining image to `inflateGzipMember` and checks for the marker at the decoded member's end. The new stored-block test intentionally accepts an earlier marker inside the member. Users are therefore promised an input boundary the parser no longer enforces.

Update the guide, specification, and parser comments to describe the current bounds. The documentation rule requires guides to describe existing behavior and limitations; this requirement must be satisfied before merging.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Adds inspect_kernel_build_config and inspect-kernel-build-config for offline kernel banners and embedded build settings.

  • Kernel images now yield a version banner and a readable build config.
  • The CLI and MCP can inspect a caller-selected kernel file.
  • Kernel image and module readers now share compression-magic checks.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A["CLI or MCP request"] --> B["Shared input checks"]
  B --> C["Stable regular-file read"]
  C --> D{"Image format"}
  D -->|"ELF or raw image"| E["Search file bytes"]
  D -->|"gzip bzImage"| F["Inflate within payload budget"]
  F --> G["Search inflated bytes"]
  D -->|"Other compressed stream"| H["Unsupported result"]
  E --> I["Read banner and check config member"]
  G --> I
  I --> J["Filter and page config entries"]
  J --> K["Check report and attach Evidence"]
  H --> K
Loading

Reviews (4) · Last reviewed commit: "fix(elf): frame kernel configs by gzip m..." · Reviewed by Greptile

Comment thread src/native/elf/KernelBuildConfig.ts Resolved
Comment thread src/native/elf/KernelBuildConfig.ts Resolved
Comment thread src/native/elf/KernelBuildConfig.ts Resolved
Comment thread src/native/elf/KernelBuildConfig.ts Resolved
Comment thread src/native/elf/KernelBuildConfig.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7c950b3a0b

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/native/elf/KernelBuildConfig.ts Resolved
Comment thread src/native/elf/KernelBuildConfig.ts Resolved
When FHCRC is set, compare the low 16 bits of the header CRC-32 before
inflating, so a damaged header no longer yields a present config or an
inflated bzImage payload.
Codec detection now reads the same payload_offset/payload_length slice that
is inflated, so bytes past a short payload cannot name its codec.
A damaged or cut-off deflate stream between IKCFG_ST and IKCFG_ED was
skipped and could end as an absent config with complete coverage. It is
now malformed with config_gzip_invalid, and a later valid config still wins.
Config text is read one line at a time instead of split into an array, and
a quoted value is validated before it is decoded once. The 4096-character
string cap is removed: Kconfig has no such limit and max_config_bytes
already bounds every line, so a long CONFIG_EXTRA_FIRMWARE list is no
longer reported as malformed.
The parser ran synchronously, so an abort raised during parsing could not
change the signal before it returned. Inflation now runs on the zlib thread
pool and each scan yields to the event loop once per MiB, so the existing
cancellation checks observe a real abort.
Budget failures are now KernelBuildConfigBudgetFailure with a knob field,
and the provider builds its recovery advice from that field instead of
searching the diagnostic message for an option name.
The documentation guide assigns analyst workflows to docs/guides/<domain>/.
Move the guide there, place its navigation and directory entries in the
Native binaries group, and update links from the docs index, CLI guide,
spec and authored skill. The public /kernel-build-config route is unchanged.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 28346f526a

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/native/elf/KernelBuildConfig.ts Resolved
Comment thread src/native/elf/KernelBuildConfig.ts Resolved
A config made of one long quoted value never reached the per-line yield, so
the control-byte check, value validation and SHA-256 ran in one synchronous
block. Each now works one MiB window per event-loop turn, and the line
patterns match only a bounded name prefix instead of the whole value.
Entry names and values were V8 slices of the whole decoded config, so a
one-entry page kept the full text alive. Entries in the returned page are
now standalone copies, so retained memory follows the page size.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c08819d160

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/native/elf/KernelBuildConfig.ts Resolved
mvanhorn and others added 2 commits November 9, 2026 04:08
IKCFG_ST, IKCFG_ED and banner searches used one Buffer.indexOf over the
rest of the image, so a large image with no marker never yielded. They now
search overlapping one MiB windows and yield after each window without a
match.
# Conflicts:
#	src/contracts/native/binaryDiagnosticsToolContracts.ts
#	src/contracts/toolEffects.ts

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 209b4d9f2f

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/native/elf/KernelBuildConfig.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e8f5f19de6

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/native/elf/KernelBuildConfig.ts Resolved
Comment thread src/native/elf/KernelBuildConfig.ts Resolved
@morluto
morluto enabled auto-merge (squash) November 9, 2026 13:41
@morluto
morluto merged commit f21fda0 into morluto:main Nov 9, 2026
4 of 6 checks passed

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3b7a588bfd

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

{ codec: "lzma", magic: Buffer.from([0x5d, 0x00, 0x00]) },
{ codec: "xz", magic: Buffer.from([0xfd, 0x37, 0x7a, 0x58, 0x5a, 0x00]) },
{ codec: "lzo", magic: Buffer.from([0x89, 0x4c, 0x5a]) },
{ codec: "lz4", magic: Buffer.from([0x02, 0x21, 0x4c, 0x18]) },

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Recognize framed LZ4 streams before scanning the file

For an Image.lz4 using the standard LZ4 frame signature (04 22 4d 18), this table recognizes only the legacy signature, so parseKernelBuildConfig searches the compressed bytes as an uncompressed image. In an isolated source-parser probe, a frame generated by LZ4F_compressFrame from an image containing a valid IKCFG returned an absent config with complete coverage, while the original image returned present. Recognize the standard frame signature as lz4 too, so these files produce the advertised unsupported-codec result rather than negative evidence about their compressed contents.

AGENTS.md reference: AGENTS.md:L21-L21

Useful? React with 👍 / 👎.


/** Matches a Kconfig `int` or `hex` value as written to `.config`. */
export const KERNEL_BUILD_CONFIG_NUMBER =
/^(?:-?(?:0|[1-9][0-9]*)|0[xX][0-9A-Fa-f]+)$/u;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Accept Kconfig hex values without a 0x prefix

When an embedded config contains a valid hex assignment without the optional 0x prefix, such as CONFIG_PAGE_OFFSET=C0000000, this expression rejects it. Consequently, classifyValue makes parseConfigText reject the entire CRC-valid config as config_text_invalid, even when the caller requests an unrelated option. Accept the unprefixed hex spelling while preserving its source text; this shared matcher also gates KernelBuildConfigService.valueAgrees, so the service currently rejects the same valid representation.

AGENTS.md reference: AGENTS.md:L97-L97

Useful? React with 👍 / 👎.

compiler: string | null;
} | null => {
let rest = text.slice(BANNER_PREFIX.length);
const version = /^[0-9][0-9A-Za-z.+_~-]*/u.exec(rest)?.[0];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Custom kernel versions are shortened

parseBannerText cuts a release token at characters such as @ or :. For Linux version 6.6.0@vendor (builder@host) (gcc) #1, it reports version: "6.6.0" and loses both builder and compiler. Custom kernel release suffixes can contain these characters, so analysts receive incomplete build details even though the full banner was found.

Read the full version token before splitting the following groups, and update bannerAgrees to accept the same token.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/native/elf/KernelBuildConfig.ts
Line: 526

Comment:
**Custom kernel versions are shortened**

`parseBannerText` cuts a release token at characters such as `@` or `:`. For `Linux version 6.6.0@vendor (builder@host) (gcc) #1`, it reports `version: "6.6.0"` and loses both `builder` and `compiler`. Custom kernel release suffixes can contain these characters, so analysts receive incomplete build details even though the full banner was found.

Read the full version token before splitting the following groups, and update `bannerAgrees` to accept the same token.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Comment on lines +44 to +45
- The member trailer ends exactly at the first `IKCFG_ED` after the gzip
header. Inflation reads only the bytes up to that marker.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Guide promises outdated read bounds

The guide still says inflation stops at the first IKCFG_ED, but the latest change passes the remaining image to inflateGzipMember and checks for the marker at the decoded member's end. The new stored-block test intentionally accepts an earlier marker inside the member. Users are therefore promised an input boundary the parser no longer enforces.

Update the guide, specification, and parser comments to describe the current bounds. The documentation rule requires guides to describe existing behavior and limitations; this requirement must be satisfied before merging.

Context Used: Documentation (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: docs/guides/native/kernel-build-config.md
Line: 44-45

Comment:
**Guide promises outdated read bounds**

The guide still says inflation stops at the first `IKCFG_ED`, but the latest change passes the remaining image to `inflateGzipMember` and checks for the marker at the decoded member's end. The new stored-block test intentionally accepts an earlier marker inside the member. Users are therefore promised an input boundary the parser no longer enforces.

Update the guide, specification, and parser comments to describe the current bounds. The documentation rule requires guides to describe existing behavior and limitations; this requirement must be satisfied before merging.

**Context Used:** Documentation ([source](https://github.com/morluto/rea/blob/main/docs))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@morluto morluto added area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior enhancement New feature or request labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants