Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Platform:Linux kernel

From ReverseEngineering.wiki
Platform
On this wiki Facts · Code · Notes · Topics

The Linux kernel as an analyst meets it in files: vmlinux and compressed boot images, loadable modules (.ko), the kallsyms symbol table, BTF type information and the initramfs archive.

Hub for the file artifacts of the Linux kernel (GPL-2.0, torvalds/linux). Kernel binaries are ELF files (vmlinux; .ko modules are ET_REL objects), but analysis often starts from something that is not ELF yet.

Topics

Workflow

  1. Identify the container: bzImage (HdrS at 0x202), U-Boot uImage (27 05 19 56), Android boot.img (ANDROID!), or a plain vmlinux ELF.
  2. Find and decompress the payload (gzip, xz, bzip2, lzma, lzo, lz4, zstd); scripts/extract-vmlinux in the kernel tree and vmlinux-to-elf do this.
  3. Recover symbols from kallsyms and types from BTF when present.
  4. For modules read .modinfo first: vermagic gives the kernel release and configuration flags.

Pitfalls

  • Layouts differ per kernel version and configuration (CONFIG_KALLSYMS_BASE_RELATIVE, CONFIG_MODVERSIONS, RANDSTRUCT); read the Linux version ... banner before trusting a layout.
  • Vendor kernels (Android, router firmware) patch the upstream sources.