v5.12+ regression on page_poison=1 i_on_free=0 i_on_alloc=0 warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In
  https://bugs.gentoo.org/801481
  https://bugzilla.kernel.org/show_bug.cgi?id=213697
bowsingbetee noticed that the following setup causes kernel to complain
about poisoning on memset(0) pages:

- kernel command: page_poison=1 init_on_free=0 init_on_alloc=0
- kernel config:
  * CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
  * CONFIG_INIT_ON_FREE_DEFAULT_ON=y
  * CONFIG_PAGE_POISONING=y

v5.12 works ok, boots as:
  [    0.009691][    T0] mem auto-init: stack:off, heap alloc:off, heap free:off

v5.13 warns, boots as:
  [    0.009746][    T0] mem auto-init: stack:off, heap alloc:on, heap free:on

Current 5.14-rc1 is also affected:

[    0.009233][    T0] mem auto-init: stack:off, heap alloc:on, heap free:on
[    0.009234][    T0] mem auto-init: clearing system memory may take some time...
[    0.396784][    T0] pagealloc: memory corruption
[    0.396788][    T0] ffff888100000000: 00 00 00 00 00 00 00 00 00 00 00 00 00
                                         00 00 00  ................

I attempted to bisect it and found the follwing relevant commits:

Before the following commit no warnings were present:

  commit 51cba1ebc60df9c4ce034a9f5441169c0d0956c0
  Author: Kees Cook <keescook@xxxxxxxxxxxx>
  Date:   Thu Apr 1 16:23:43 2021 -0700
    init_on_alloc: Optimize static branches

Next after this commit kernel does not boot. Makes it harder to
bisect the poisoning warning

After the commit below kernel boots and already complains about
poisoning of zero pages:

  commit 1bb5eab30d68c1a3d9dbc822e1895e6c06dbe748
  Author: Andrey Konovalov <andreyknvl@xxxxxxxxxx>
  Date:   Thu Apr 29 23:00:02 2021 -0700
    kasan, mm: integrate page_alloc init with HW_TAGS

It looks like a case of page_poison=1 not having enough
of a priority over init_on_free=0 init_on_alloc=0 at early boot.

-- 

  Sergei




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux