[v2,2/3] doc/vm: add information about page_table_check warn_on behavior

Message ID 20230722231508.1030269-3-pasha.tatashin@soleen.com
State New
Headers
Series page table check warn instead of panic |

Commit Message

Pasha Tatashin July 22, 2023, 11:15 p.m. UTC
  The default behavior of page table check was changed from panicking
kernel to printing a warning.

Add a note how to still panic the kernel when error is detected.

Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
---
 Documentation/mm/page_table_check.rst | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
  

Comments

Randy Dunlap July 22, 2023, 11:59 p.m. UTC | #1
Hi--

On 7/22/23 16:15, Pasha Tatashin wrote:
> The default behavior of page table check was changed from panicking
> kernel to printing a warning.
> 
> Add a note how to still panic the kernel when error is detected.
> 
> Signed-off-by: Pasha Tatashin<pasha.tatashin@soleen.com>
> ---
>   Documentation/mm/page_table_check.rst | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/mm/page_table_check.rst b/Documentation/mm/page_table_check.rst
> index c12838ce6b8d..f534c80ee9c9 100644
> --- a/Documentation/mm/page_table_check.rst
> +++ b/Documentation/mm/page_table_check.rst
> @@ -14,13 +14,14 @@ Page table check performs extra verifications at the time when new pages become
>   accessible from the userspace by getting their page table entries (PTEs PMDs
>   etc.) added into the table.
>   
> -In case of detected corruption, the kernel is crashed. There is a small
> +In case of detected corruption, a warning is printed. There is a small
>   performance and memory overhead associated with the page table check. Therefore,
>   it is disabled by default, but can be optionally enabled on systems where the
>   extra hardening outweighs the performance costs. Also, because page table check
>   is synchronous, it can help with debugging double map memory corruption issues,
>   by crashing kernel at the time wrong mapping occurs instead of later which is
> -often the case with memory corruptions bugs.
> +often the case with memory corruptions bugs. In order to crash kernel sysctl
> +panic_on_warn should be set to 1.

Better as:
   In order to crash the kernel, the sysctl panic_on_warn should be set 
to 1.
  
Pasha Tatashin July 23, 2023, 3:37 a.m. UTC | #2
On Sat, Jul 22, 2023 at 7:59 PM Randy Dunlap <rdunlap@infradead.org> wrote:
>
> Hi--
>
> On 7/22/23 16:15, Pasha Tatashin wrote:
> > The default behavior of page table check was changed from panicking
> > kernel to printing a warning.
> >
> > Add a note how to still panic the kernel when error is detected.
> >
> > Signed-off-by: Pasha Tatashin<pasha.tatashin@soleen.com>
> > ---
> >   Documentation/mm/page_table_check.rst | 5 +++--
> >   1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/Documentation/mm/page_table_check.rst b/Documentation/mm/page_table_check.rst
> > index c12838ce6b8d..f534c80ee9c9 100644
> > --- a/Documentation/mm/page_table_check.rst
> > +++ b/Documentation/mm/page_table_check.rst
> > @@ -14,13 +14,14 @@ Page table check performs extra verifications at the time when new pages become
> >   accessible from the userspace by getting their page table entries (PTEs PMDs
> >   etc.) added into the table.
> >
> > -In case of detected corruption, the kernel is crashed. There is a small
> > +In case of detected corruption, a warning is printed. There is a small
> >   performance and memory overhead associated with the page table check. Therefore,
> >   it is disabled by default, but can be optionally enabled on systems where the
> >   extra hardening outweighs the performance costs. Also, because page table check
> >   is synchronous, it can help with debugging double map memory corruption issues,
> >   by crashing kernel at the time wrong mapping occurs instead of later which is
> > -often the case with memory corruptions bugs.
> > +often the case with memory corruptions bugs. In order to crash kernel sysctl
> > +panic_on_warn should be set to 1.
>
> Better as:
>    In order to crash the kernel, the sysctl panic_on_warn should be set
> to 1.

Will update in the next version.

Thanks,
Pasha

>
  

Patch

diff --git a/Documentation/mm/page_table_check.rst b/Documentation/mm/page_table_check.rst
index c12838ce6b8d..f534c80ee9c9 100644
--- a/Documentation/mm/page_table_check.rst
+++ b/Documentation/mm/page_table_check.rst
@@ -14,13 +14,14 @@  Page table check performs extra verifications at the time when new pages become
 accessible from the userspace by getting their page table entries (PTEs PMDs
 etc.) added into the table.
 
-In case of detected corruption, the kernel is crashed. There is a small
+In case of detected corruption, a warning is printed. There is a small
 performance and memory overhead associated with the page table check. Therefore,
 it is disabled by default, but can be optionally enabled on systems where the
 extra hardening outweighs the performance costs. Also, because page table check
 is synchronous, it can help with debugging double map memory corruption issues,
 by crashing kernel at the time wrong mapping occurs instead of later which is
-often the case with memory corruptions bugs.
+often the case with memory corruptions bugs. In order to crash kernel sysctl
+panic_on_warn should be set to 1.
 
 Double mapping detection logic
 ==============================