Linux Kernel & OS

Linux 7.5 adds hwpoison-panic tool for testing kernel memory failure handling

Key Takeaway

A new kernel testing utility enables developers to intentionally trigger panics via injected hardware memory errors on specific kernel page types, without requiring actual ECC hardware failures.

Summary

The upcoming Linux 7.5 kernel will include hwpoison-panic, a new testing tool that injects hardware poison errors into kernel-owned memory pages to verify the vm.panic_on_unrecoverable_memory_failure sysctl behavior. This utility targets three specific page types: kernel read-only data (rodata), slab pages, and page-table pages, and requires an explicit --yes-panic-my-kernel flag to prevent accidental execution.

The tool addresses a practical testing gap by allowing kernel developers and QA engineers to validate panic paths without depending on rare multi-bit ECC errors or similar physical hardware faults. It is designed primarily for virtual machine environments where serial console output can be captured to confirm the resulting kernel panic and system crash behavior.

Kernel memory failure testing mechanics

  • Target page types: The tool can inject hardware poison errors on three distinct kernel page categories: rodata (read-only data), slab pages, and page-table pages.
  • Sysctl integration: hwpoison-panic exercises the vm.panic_on_unrecoverable_memory_failure kernel option, which forces immediate panic on unrecoverable memory failures affecting specific kernel-owned page types.
  • Safety mechanism: Execution requires the --yes-panic-my-kernel argument to prevent unintentional system crashes from accidental invocation.
  • VM-focused workflow: Primary testing environment is virtualized infrastructure with serial console capture capability, enabling verification of panic output without physical hardware access.
  • Merge status: The patch is currently queued in Andrew Morton's MM Git "for-next" branch, targeting inclusion in the Linux 7.5 release cycle.

Why it matters

This tooling lowers the barrier for validating critical kernel reliability paths that previously required specialized ECC-capable hardware and unpredictable fault conditions. For Linux distribution maintainers, cloud providers, and enterprise kernel engineering teams, hwpoison-panic enables reproducible regression testing of memory failure handling in CI pipelines and automated VM test farms.

Original reference: www.phoronix.com →