<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/mm/Kconfig.debug, branch v5.0</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.0</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.0'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2018-08-22T17:52:44Z</updated>
<entry>
<title>mm: clarify CONFIG_PAGE_POISONING and usage</title>
<updated>2018-08-22T17:52:44Z</updated>
<author>
<name>Kees Cook</name>
<email>keescook@chromium.org</email>
</author>
<published>2018-08-22T04:53:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8c9a134cae6f8d66f35321b07baa202f75ef2199'/>
<id>urn:sha1:8c9a134cae6f8d66f35321b07baa202f75ef2199</id>
<content type='text'>
The Kconfig text for CONFIG_PAGE_POISONING doesn't mention that it has to
be enabled explicitly.  This updates the documentation for that and adds a
note about CONFIG_PAGE_POISONING to the "page_poison" command line docs.
While here, change description of CONFIG_PAGE_POISONING_ZERO too, as it's
not "random" data, but rather the fixed debugging value that would be used
when not zeroing.  Additionally removes a stray "bool" in the Kconfig.

Link: http://lkml.kernel.org/r/20180725223832.GA43733@beast
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Reviewed-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Jonathan Corbet &lt;corbet@lwn.net&gt;
Cc: Laura Abbott &lt;labbott@redhat.com&gt;
Cc: Naoya Horiguchi &lt;n-horiguchi@ah.jp.nec.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>kmemcheck: rip it out</title>
<updated>2017-11-16T02:21:05Z</updated>
<author>
<name>Levin, Alexander (Sasha Levin)</name>
<email>alexander.levin@verizon.com</email>
</author>
<published>2017-11-16T01:36:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4675ff05de2d76d167336b368bd07f3fef6ed5a6'/>
<id>urn:sha1:4675ff05de2d76d167336b368bd07f3fef6ed5a6</id>
<content type='text'>
Fix up makefiles, remove references, and git rm kmemcheck.

Link: http://lkml.kernel.org/r/20171007030159.22241-4-alexander.levin@verizon.com
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Vegard Nossum &lt;vegardno@ifi.uio.no&gt;
Cc: Pekka Enberg &lt;penberg@kernel.org&gt;
Cc: Michal Hocko &lt;mhocko@kernel.org&gt;
Cc: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Cc: Alexander Potapenko &lt;glider@google.com&gt;
Cc: Tim Hansen &lt;devtimhansen@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>mm: enable page poisoning early at boot</title>
<updated>2017-05-03T22:52:10Z</updated>
<author>
<name>Vinayak Menon</name>
<email>vinmenon@codeaurora.org</email>
</author>
<published>2017-05-03T21:54:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bd33ef3681359343863f2290aded182b0441edee'/>
<id>urn:sha1:bd33ef3681359343863f2290aded182b0441edee</id>
<content type='text'>
On SPARSEMEM systems page poisoning is enabled after buddy is up,
because of the dependency on page extension init.  This causes the pages
released by free_all_bootmem not to be poisoned.  This either delays or
misses the identification of some issues because the pages have to
undergo another cycle of alloc-free-alloc for any corruption to be
detected.

Enable page poisoning early by getting rid of the PAGE_EXT_DEBUG_POISON
flag.  Since all the free pages will now be poisoned, the flag need not
be verified before checking the poison during an alloc.

[vinmenon@codeaurora.org: fix Kconfig]
  Link: http://lkml.kernel.org/r/1490878002-14423-1-git-send-email-vinmenon@codeaurora.org
Link: http://lkml.kernel.org/r/1490358246-11001-1-git-send-email-vinmenon@codeaurora.org
Signed-off-by: Vinayak Menon &lt;vinmenon@codeaurora.org&gt;
Acked-by: Laura Abbott &lt;labbott@redhat.com&gt;
Tested-by: Laura Abbott &lt;labbott@redhat.com&gt;
Cc: Joonsoo Kim &lt;iamjoonsoo.kim@lge.com&gt;
Cc: Michal Hocko &lt;mhocko@suse.com&gt;
Cc: Akinobu Mita &lt;akinobu.mita@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>mm: add arch-independent testcases for RODATA</title>
<updated>2017-02-28T02:43:48Z</updated>
<author>
<name>Jinbum Park</name>
<email>jinb.park7@gmail.com</email>
</author>
<published>2017-02-27T22:30:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2959a5f726f6510d6dd7c958f8877e08d0cf589c'/>
<id>urn:sha1:2959a5f726f6510d6dd7c958f8877e08d0cf589c</id>
<content type='text'>
This patch makes arch-independent testcases for RODATA.  Both x86 and
x86_64 already have testcases for RODATA, But they are arch-specific
because using inline assembly directly.

And cacheflush.h is not a suitable location for rodata-test related
things.  Since they were in cacheflush.h, If someone change the state of
CONFIG_DEBUG_RODATA_TEST, It cause overhead of kernel build.

To solve the above issues, write arch-independent testcases and move it
to shared location.

[jinb.park7@gmail.com: fix config dependency]
  Link: http://lkml.kernel.org/r/20170209131625.GA16954@pjb1027-Latitude-E5410
Link: http://lkml.kernel.org/r/20170129105436.GA9303@pjb1027-Latitude-E5410
Signed-off-by: Jinbum Park &lt;jinb.park7@gmail.com&gt;
Acked-by: Kees Cook &lt;keescook@chromium.org&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Arjan van de Ven &lt;arjan@linux.intel.com&gt;
Cc: Laura Abbott &lt;labbott@redhat.com&gt;
Cc: Russell King &lt;linux@armlinux.org.uk&gt;
Cc: Valentin Rothberg &lt;valentinrothberg@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>PM / Hibernate: allow hibernation with PAGE_POISONING_ZERO</title>
<updated>2016-09-13T00:35:27Z</updated>
<author>
<name>Anisse Astier</name>
<email>anisse@astier.eu</email>
</author>
<published>2016-09-09T08:43:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1ad1410f632d4141221634308a5e56f339f92009'/>
<id>urn:sha1:1ad1410f632d4141221634308a5e56f339f92009</id>
<content type='text'>
PAGE_POISONING_ZERO disables zeroing new pages on alloc, they are
poisoned (zeroed) as they become available.
In the hibernate use case, free pages will appear in the system without
being cleared, left there by the loading kernel.

This patch will make sure free pages are cleared on resume when
PAGE_POISONING_ZERO is enabled. We free the pages just after resume
because we can't do it later: going through any device resume code might
allocate some memory and invalidate the free pages bitmap.

Thus we don't need to disable hibernation when PAGE_POISONING_ZERO is
enabled.

Signed-off-by: Anisse Astier &lt;anisse@astier.eu&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Acked-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>mm/page_ref: add tracepoint to track down page reference manipulation</title>
<updated>2016-03-17T22:09:34Z</updated>
<author>
<name>Joonsoo Kim</name>
<email>iamjoonsoo.kim@lge.com</email>
</author>
<published>2016-03-17T21:19:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=95813b8faa0cd315f61a8b9d9c523792370b693e'/>
<id>urn:sha1:95813b8faa0cd315f61a8b9d9c523792370b693e</id>
<content type='text'>
CMA allocation should be guaranteed to succeed by definition, but,
unfortunately, it would be failed sometimes.  It is hard to track down
the problem, because it is related to page reference manipulation and we
don't have any facility to analyze it.

This patch adds tracepoints to track down page reference manipulation.
With it, we can find exact reason of failure and can fix the problem.
Following is an example of tracepoint output.  (note: this example is
stale version that printing flags as the number.  Recent version will
print it as human readable string.)

&lt;...&gt;-9018  [004]    92.678375: page_ref_set:         pfn=0x17ac9 flags=0x0 count=1 mapcount=0 mapping=(nil) mt=4 val=1
&lt;...&gt;-9018  [004]    92.678378: kernel_stack:
 =&gt; get_page_from_freelist (ffffffff81176659)
 =&gt; __alloc_pages_nodemask (ffffffff81176d22)
 =&gt; alloc_pages_vma (ffffffff811bf675)
 =&gt; handle_mm_fault (ffffffff8119e693)
 =&gt; __do_page_fault (ffffffff810631ea)
 =&gt; trace_do_page_fault (ffffffff81063543)
 =&gt; do_async_page_fault (ffffffff8105c40a)
 =&gt; async_page_fault (ffffffff817581d8)
[snip]
&lt;...&gt;-9018  [004]    92.678379: page_ref_mod:         pfn=0x17ac9 flags=0x40048 count=2 mapcount=1 mapping=0xffff880015a78dc1 mt=4 val=1
[snip]
...
...
&lt;...&gt;-9131  [001]    93.174468: test_pages_isolated:  start_pfn=0x17800 end_pfn=0x17c00 fin_pfn=0x17ac9 ret=fail
[snip]
&lt;...&gt;-9018  [004]    93.174843: page_ref_mod_and_test: pfn=0x17ac9 flags=0x40068 count=0 mapcount=0 mapping=0xffff880015a78dc1 mt=4 val=-1 ret=1
 =&gt; release_pages (ffffffff8117c9e4)
 =&gt; free_pages_and_swap_cache (ffffffff811b0697)
 =&gt; tlb_flush_mmu_free (ffffffff81199616)
 =&gt; tlb_finish_mmu (ffffffff8119a62c)
 =&gt; exit_mmap (ffffffff811a53f7)
 =&gt; mmput (ffffffff81073f47)
 =&gt; do_exit (ffffffff810794e9)
 =&gt; do_group_exit (ffffffff81079def)
 =&gt; SyS_exit_group (ffffffff81079e74)
 =&gt; entry_SYSCALL_64_fastpath (ffffffff817560b6)

This output shows that problem comes from exit path.  In exit path, to
improve performance, pages are not freed immediately.  They are gathered
and processed by batch.  During this process, migration cannot be
possible and CMA allocation is failed.  This problem is hard to find
without this page reference tracepoint facility.

Enabling this feature bloat kernel text 30 KB in my configuration.

   text    data     bss     dec     hex filename
12127327        2243616 1507328 15878271         f2487f vmlinux_disabled
12157208        2258880 1507328 15923416         f2f8d8 vmlinux_enabled

Note that, due to header file dependency problem between mm.h and
tracepoint.h, this feature has to open code the static key functions for
tracepoints.  Proposed by Steven Rostedt in following link.

https://lkml.org/lkml/2015/12/9/699

[arnd@arndb.de: crypto/async_pq: use __free_page() instead of put_page()]
[iamjoonsoo.kim@lge.com: fix build failure for xtensa]
[akpm@linux-foundation.org: tweak Kconfig text, per Vlastimil]
Signed-off-by: Joonsoo Kim &lt;iamjoonsoo.kim@lge.com&gt;
Acked-by: Michal Nazarewicz &lt;mina86@mina86.com&gt;
Acked-by: Vlastimil Babka &lt;vbabka@suse.cz&gt;
Cc: Minchan Kim &lt;minchan@kernel.org&gt;
Cc: Mel Gorman &lt;mgorman@techsingularity.net&gt;
Cc: "Kirill A. Shutemov" &lt;kirill.shutemov@linux.intel.com&gt;
Cc: Sergey Senozhatsky &lt;sergey.senozhatsky.work@gmail.com&gt;
Acked-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>mm/page_poisoning.c: allow for zero poisoning</title>
<updated>2016-03-15T23:55:16Z</updated>
<author>
<name>Laura Abbott</name>
<email>labbott@fedoraproject.org</email>
</author>
<published>2016-03-15T21:56:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1414c7f4f7d72d138fff35f00151d15749b5beda'/>
<id>urn:sha1:1414c7f4f7d72d138fff35f00151d15749b5beda</id>
<content type='text'>
By default, page poisoning uses a poison value (0xaa) on free.  If this
is changed to 0, the page is not only sanitized but zeroing on alloc
with __GFP_ZERO can be skipped as well.  The tradeoff is that detecting
corruption from the poisoning is harder to detect.  This feature also
cannot be used with hibernation since pages are not guaranteed to be
zeroed after hibernation.

Credit to Grsecurity/PaX team for inspiring this work

Signed-off-by: Laura Abbott &lt;labbott@fedoraproject.org&gt;
Acked-by: Rafael J. Wysocki &lt;rjw@rjwysocki.net&gt;
Cc: "Kirill A. Shutemov" &lt;kirill.shutemov@linux.intel.com&gt;
Cc: Vlastimil Babka &lt;vbabka@suse.cz&gt;
Cc: Michal Hocko &lt;mhocko@suse.com&gt;
Cc: Kees Cook &lt;keescook@chromium.org&gt;
Cc: Mathias Krause &lt;minipli@googlemail.com&gt;
Cc: Dave Hansen &lt;dave.hansen@intel.com&gt;
Cc: Jianyu Zhan &lt;nasa4836@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>mm/page_poison.c: enable PAGE_POISONING as a separate option</title>
<updated>2016-03-15T23:55:16Z</updated>
<author>
<name>Laura Abbott</name>
<email>labbott@fedoraproject.org</email>
</author>
<published>2016-03-15T21:56:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8823b1dbc05fab1a8bec275eeae4709257c2661d'/>
<id>urn:sha1:8823b1dbc05fab1a8bec275eeae4709257c2661d</id>
<content type='text'>
Page poisoning is currently set up as a feature if architectures don't
have architecture debug page_alloc to allow unmapping of pages.  It has
uses apart from that though.  Clearing of the pages on free provides an
increase in security as it helps to limit the risk of information leaks.
Allow page poisoning to be enabled as a separate option independent of
kernel_map pages since the two features do separate work.  Because of
how hiberanation is implemented, the checks on alloc cannot occur if
hibernation is enabled.  The runtime alloc checks can also be enabled
with an option when !HIBERNATION.

Credit to Grsecurity/PaX team for inspiring this work

Signed-off-by: Laura Abbott &lt;labbott@fedoraproject.org&gt;
Cc: Rafael J. Wysocki &lt;rjw@rjwysocki.net&gt;
Cc: "Kirill A. Shutemov" &lt;kirill.shutemov@linux.intel.com&gt;
Cc: Vlastimil Babka &lt;vbabka@suse.cz&gt;
Cc: Michal Hocko &lt;mhocko@suse.com&gt;
Cc: Kees Cook &lt;keescook@chromium.org&gt;
Cc: Mathias Krause &lt;minipli@googlemail.com&gt;
Cc: Dave Hansen &lt;dave.hansen@intel.com&gt;
Cc: Jianyu Zhan &lt;nasa4836@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>mm/debug_pagealloc: ask users for default setting of debug_pagealloc</title>
<updated>2016-03-15T23:55:16Z</updated>
<author>
<name>Christian Borntraeger</name>
<email>borntraeger@de.ibm.com</email>
</author>
<published>2016-03-15T21:55:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ea6eabb05b26bd3d6f60b29b77a03bc61479fc0f'/>
<id>urn:sha1:ea6eabb05b26bd3d6f60b29b77a03bc61479fc0f</id>
<content type='text'>
Since commit 031bc5743f158 ("mm/debug-pagealloc: make debug-pagealloc
boottime configurable") CONFIG_DEBUG_PAGEALLOC is by default not adding
any page debugging.

This resulted in several unnoticed bugs, e.g.

    https://lkml.kernel.org/g/&lt;569F5E29.3090107@de.ibm.com&gt;
or
    https://lkml.kernel.org/g/&lt;56A20F30.4050705@de.ibm.com&gt;

as this behaviour change was not even documented in Kconfig.

Let's provide a new Kconfig symbol that allows to change the default
back to enabled, e.g.  for debug kernels.  This also makes the change
obvious to kernel packagers.

Let's also change the Kconfig description for CONFIG_DEBUG_PAGEALLOC, to
indicate that there are two stages of overhead.

Signed-off-by: Christian Borntraeger &lt;borntraeger@de.ibm.com&gt;
Cc: Joonsoo Kim &lt;iamjoonsoo.kim@lge.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>mm/debug_pagealloc: remove obsolete Kconfig options</title>
<updated>2015-01-08T23:10:52Z</updated>
<author>
<name>Joonsoo Kim</name>
<email>iamjoonsoo.kim@lge.com</email>
</author>
<published>2015-01-08T22:32:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=70ecb3cb033f37fd5024448f809ea028fb85c28b'/>
<id>urn:sha1:70ecb3cb033f37fd5024448f809ea028fb85c28b</id>
<content type='text'>
These are obsolete since commit e30825f1869a ("mm/debug-pagealloc:
prepare boottime configurable") was merged.  So remove them.

[pebolle@tiscali.nl: find obsolete Kconfig options]
Signed-off-by: Joonsoo Kim &lt;iamjoonsoo.kim@lge.com&gt;
Cc: Paul Bolle &lt;pebolle@tiscali.nl&gt;
Cc: Mel Gorman &lt;mgorman@suse.de&gt;
Cc: Johannes Weiner &lt;hannes@cmpxchg.org&gt;
Cc: Minchan Kim &lt;minchan@kernel.org&gt;
Cc: Dave Hansen &lt;dave@sr71.net&gt;
Cc: Michal Nazarewicz &lt;mina86@mina86.com&gt;
Cc: Jungsoo Son &lt;jungsoo.son@lge.com&gt;
Acked-by: David Rientjes &lt;rientjes@google.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
