summaryrefslogtreecommitdiff
path: root/lib/usercopy.c
diff options
context:
space:
mode:
authorAlexander Potapenko <glider@google.com>2016-03-25 14:21:56 -0700
committerPaul Lawrence <paullawrence@google.com>2017-12-14 08:22:31 -0800
commitadb03f57aa738efed8d3d0ee4309b05e499370a0 (patch)
tree913167031a04224f4507984cd00c8033326f975f /lib/usercopy.c
parentb8bff7a41314f518c21df0995577b41c9c0ec9ec (diff)
UPSTREAM: kasan: modify kmalloc_large_oob_right(), add kmalloc_pagealloc_oob_right()
This patchset implements SLAB support for KASAN Unlike SLUB, SLAB doesn't store allocation/deallocation stacks for heap objects, therefore we reimplement this feature in mm/kasan/stackdepot.c. The intention is to ultimately switch SLUB to use this implementation as well, which will save a lot of memory (right now SLUB bloats each object by 256 bytes to store the allocation/deallocation stacks). Also neither SLUB nor SLAB delay the reuse of freed memory chunks, which is necessary for better detection of use-after-free errors. We introduce memory quarantine (mm/kasan/quarantine.c), which allows delayed reuse of deallocated memory. This patch (of 7): Rename kmalloc_large_oob_right() to kmalloc_pagealloc_oob_right(), as the test only checks the page allocator functionality. Also reimplement kmalloc_large_oob_right() so that the test allocates a large enough chunk of memory that still does not trigger the page allocator fallback. Signed-off-by: Alexander Potapenko <glider@google.com> Cc: Christoph Lameter <cl@linux.com> Cc: Pekka Enberg <penberg@kernel.org> Cc: David Rientjes <rientjes@google.com> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Cc: Andrey Konovalov <adech.fo@gmail.com> Cc: Dmitry Vyukov <dvyukov@google.com> Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Konstantin Serebryany <kcc@google.com> Cc: Dmitry Chernenkov <dmitryc@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Bug: 64145065 (cherry-picked from e6e8379c876de16c6b78f83b15d5ac32c79cb440) Change-Id: Id711a46b1d85d84784bc599295d109f8f0c7f272 Signed-off-by: Paul Lawrence <paullawrence@google.com>
Diffstat (limited to 'lib/usercopy.c')
0 files changed, 0 insertions, 0 deletions