Re: [PATCH 1/1] mm: sysctl: add panic_on_mm_error sysctl

From: Qian Cai
Date: Mon Jan 27 2020 - 07:26:26 EST




> On Jan 27, 2020, at 5:11 AM, Grzegorz Halat <ghalat@xxxxxxxxxx> wrote:
>
> Memory management subsystem performs various checks at runtime,
> if an inconsistency is detected then such event is being logged and kernel
> continues to run. While debugging such problems it is helpful to collect
> memory dump as early as possible. Currently, there is no easy way to panic
> kernel when such error is detected.
>
> It was proposed[1] to panic the kernel if panic_on_oops is set but this
> approach was not accepted. One of alternative proposals was introduction of
> a new sysctl.
>
> The patch adds panic_on_mm_error sysctl. If the sysctl is set then the
> kernel will be crashed when an inconsistency is detected by memory
> management. This currently means panic when bad page or bad PTE
> is detected(this may be extended to other places in MM).
>
> Another use case of this sysctl may be in security-wise environments,
> it may be more desired to crash machine than continue to run with
> potentially damaged data structures.

Well, on the other hand, this will allow a normal user to more easily crash the system due to a recoverable bug which could result in local DoS.