What is the KO file format?
A .ko file is a loadable kernel module (LKM) for the Linux kernel - a binary plug-in that extends kernel functionality at runtime without requiring a reboot or recompile. Common uses include device drivers (graphics, networking, storage), filesystem implementations, and security subsystems.
Structurally, a .ko file is an ELF relocatable object (type ET_REL), sharing the standard ELF magic bytes (0x7F 0x45 0x4C 0x46) with .so shared libraries. The distinguishing feature is a .modinfo ELF section, which stores key=value metadata readable via modinfo: author, description, license, vermagic (the exact kernel version + SMP + ABI string), and parm entries for configurable parameters. The .ko naming convention replaced the older .o suffix in Linux kernel 2.6 (2003).
Modules are loaded with insmod or modprobe and unloaded with rmmod - all part of the kmod package. The vermagic string must exactly match the running kernel; a mismatch causes load rejection. An optional __versions ELF section stores CRC32 checksums per exported symbol for ABI verification.
Since kernel 3.3+, distribution modules are routinely compressed as .ko.xz, .ko.gz, or .ko.zst; modprobe decompresses them transparently. On secure-boot systems, module signing (CONFIG_MODULE_SIG) appends an RSA or ECDSA signature after the ELF content; lockdown-enabled kernels reject unsigned modules.
Security & safety
RISK: HIGHKernel modules run with ring-0 (kernel) privilege - the highest privilege level. A malicious .ko file can do anything: install rootkits, intercept system calls, disable audit logging. Never load .ko files from untrusted sources. Distribution modules are signed; Secure Boot enforces module signature verification. If a .ko refuses to load due to signature error, investigate why rather than disabling signature enforcement.
Format details
in a nutshellPrograms that open KO files
Technical details
deep spec| Format type | ELF relocatable object (ET_REL), 32-bit or 64-bit depending on target architecture |
| Magic bytes | 0x7F 0x45 0x4C 0x46 (0x7F followed by ASCII "ELF") at file offset 0 - identical to .so shared libraries |
| Byte order | Architecture-dependent: little-endian on x86/ARM, big-endian on MIPS/PowerPC |
| Key ELF section | .modinfo - stores author, license, vermagic, version, parm, and alias metadata as key=value pairs |
| ABI enforcement | vermagic string in .modinfo encodes exact kernel version + SMP flags; mismatch causes load rejection |
| Symbol CRC | Optional __versions ELF section with CRC32 per exported kernel symbol for ABI verification |
| Module signing | RSA/ECDSA signature appended after ELF data (CONFIG_MODULE_SIG); lockdown-enabled kernels require a valid signature |
| Compression | Distribution modules compressed as .ko.xz, .ko.gz, or .ko.zst; modprobe decompresses transparently (kernel 3.3+) |
| Load tools | insmod (direct load), modprobe (dependency-aware), rmmod (unload) - all part of kmod package |
| Metadata tool | modinfo(8) reads .modinfo section; depmod(8) builds modules.dep dependency map |
| Typical size | 5 KB - 10 MB (device driver modules vary widely) |
| Naming history | .ko suffix replaced .o for kernel modules starting with Linux 2.6.0 (2003) |
| Portability | Linux only; not compatible with other ELF-based systems without kernel-side module infrastructure |
| Released | 2003 (Linux kernel 2.6; .ko replaced .o module naming convention) |
| Latest version | N/A (ELF format is stable; kernel ABI versioning via vermagic string) |
| Open standard | Yes · royalty-free |
| Specification | www.kernel.org |
KO conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about KO files.