📑 Table of Contents

kexec (kernel execute), analogous to the Unix/Linux kernel call exec, is a mechanism of the Linux kernel that allows booting of a new kernel from the currently running one.

Details

edit

Essentially, kexec skips the bootloader stage and hardware initialization phase performed by the system firmware (BIOS or UEFI), and directly loads the new kernel into main memory and starts executing it immediately. This avoids the long times associated with a full reboot, and can help systems to meet high-availability requirements by minimizing downtime.[1][2]

While feasible, implementing a mechanism such as kexec raises two major challenges:

  • Memory of the currently running kernel is overwritten by the new kernel, while the old one is still executing.
  • The new kernel will usually expect all hardware devices to be in a well defined state, in which they are after a system reboot because the system firmware resets them to a "sane" state. Bypassing a real reboot may leave devices in an unknown state, and the new kernel will have to recover from that.

Support for allowing only signed kernels to be booted through kexec was merged into version 3.17 of the Linux kernel mainline, which was released on October 5, 2014.[3] This disallows a root user to load arbitrary code via kexec and execute it, complementing the UEFI secure boot and in-kernel security mechanisms for ensuring that only signed Linux kernel modules can be inserted into the running kernel.[4][5][6]

Kexec is used by LinuxBoot to boot the main kernel from the Linux kernel located in the firmware.

See also

edit
  • kdump (Linux) – Linux kernel's crash dump mechanism, which internally uses kexec
  • kGraft – Linux kernel live patching technology developed by SUSE
  • kpatch – Linux kernel live patching technology developed by Red Hat
  • Ksplice – Linux kernel live patching technology developed by Ksplice, Inc. and later bought by Oracle

References

edit
  1. ^ Hariprasad Nellitheertha (May 4, 2004). "Reboot Linux faster using kexec". IBM. Archived from the original on January 21, 2013. Retrieved December 5, 2013.
  2. ^ David Pendell (August 16, 2008). "Reboot like a racecar with kexec". linux.com. Archived from the original on February 14, 2009. Retrieved December 5, 2013.
  3. ^ "Linux kernel 3.17, Section 1.10. Signed kexec kernels". kernelnewbies.org. October 5, 2014. Retrieved November 3, 2014.
  4. ^ Jake Edge (June 25, 2014). "Reworking kexec for signatures". LWN.net. Retrieved August 9, 2014.
  5. ^ Matthew Garrett (December 3, 2013). "Subverting security with kexec". dreamwidth.org. Retrieved December 5, 2013.
  6. ^ Kees Cook (December 10, 2013). "Live patching the kernel". outflux.net. Retrieved December 12, 2013.

📚 Artikel Terkait di Wikipedia

Kdump (Linux)

kernel" layout, kdump uses kexec for "warm" booting into the dump-capture kernel immediately after the kernel crash, using kexec's ability to boot "over"

Comparison of bootloaders

'No FreeBSD kernel provided, aborting'. "Documentation for Kdump - The kexec-based Crash Dumping Solution" (text/plain). The Linux Kernel Archives. Retrieved

Devicetree

device tree in the early stages of booting. As an example, Das U-Boot and kexec can pass a device tree when launching a new operating system. On systems

LinuxBoot

(PEI) part of UEFI, coreboot, or U-Boot. It can boot Linux through the kexec syscall, but is also able to boot Windows with a different method. Originally

Rust for Linux

Linux PAM Device drivers 802.11 graphics Raw device initramfs KernelCare kexec kGraft kpatch Ksplice Variants Mainline Linux kernel Linux-libre High-performance

Linux kernel version history

listns()". LWN.net. Retrieved 31 May 2026. Corbet, Jonathan (18 August 2025). "Kexec handover and the live update orchestrator". LWN.net. Retrieved 31 May 2026

Reboot

an alternative to warm boot; the Linux kernel has optional support for kexec, a system call which transfers execution to a new kernel and skips hardware

KernelCare

field of research focusing on upgrading programs while they are running kexec, a method for loading a whole new kernel from a running system kGraft, kpatch