linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] mm: Randomize free memory
@ 2018-09-15 16:23 Dan Williams
  2018-09-15 16:23 ` [PATCH 1/3] mm: Shuffle initial " Dan Williams
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Dan Williams @ 2018-09-15 16:23 UTC (permalink / raw)
  To: akpm; +Cc: Michal Hocko, Dave Hansen, Kees Cook, linux-mm, linux-kernel

Data exfiltration attacks via speculative execution and
return-oriented-programming attacks rely on the ability to infer the
location of sensitive data objects. The kernel page allocator, has
predictable first-in-first-out behavior for physical pages. Pages are
freed in physical address order when first onlined. There are also
mechanisms like CMA that can free large contiguous areas at once
increasing the predictability of allocations in physical memory.

In addition to the security implications this randomization also
stabilizes the average performance of direct-mapped memory-side caches.
This includes memory-side caches like the one on the Knights Landing
processor and those generally described by the ACPI HMAT (Heterogeneous
Memory Attributes Table [1]). Cache conflicts are spread over a random
distribution rather than localized.

Given the performance sensitivity of the page allocator this
randomization is only performed for MAX_ORDER (4MB by default) pages. A
kernel parameter, page_alloc.shuffle_page_order, is included to change
the page size where randomization occurs.

[1]: See ACPI 6.2 Section 5.2.27.5 Memory Side Cache Information Structure 

---

Dan Williams (3):
      mm: Shuffle initial free memory
      mm: Move buddy list manipulations into helpers
      mm: Maintain randomization of page free lists


 include/linux/list.h     |   17 +++
 include/linux/mm.h       |    5 -
 include/linux/mm_types.h |    3 +
 include/linux/mmzone.h   |   57 ++++++++++
 mm/bootmem.c             |    9 +-
 mm/compaction.c          |    4 -
 mm/nobootmem.c           |    7 +
 mm/page_alloc.c          |  267 +++++++++++++++++++++++++++++++++++++++-------
 8 files changed, 317 insertions(+), 52 deletions(-)

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-10-02 14:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-15 16:23 [PATCH 0/3] mm: Randomize free memory Dan Williams
2018-09-15 16:23 ` [PATCH 1/3] mm: Shuffle initial " Dan Williams
2018-09-15 16:23 ` [PATCH 2/3] mm: Move buddy list manipulations into helpers Dan Williams
2018-09-15 16:23 ` [PATCH 3/3] mm: Maintain randomization of page free lists Dan Williams
2018-09-17 23:12 ` [PATCH 0/3] mm: Randomize free memory Andrew Morton
2018-09-21 19:12   ` Kees Cook
2018-09-21 23:48     ` Elliott, Robert (Persistent Memory)
2018-09-22  0:06       ` Dan Williams
2018-10-02 14:30 ` Michal Hocko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).