1. 11 Nov, 2022 1 commit
    • Feng Tang's avatar
      mm/slub: extend redzone check to extra allocated kmalloc space than requested · 946fa0db
      Feng Tang authored
      kmalloc will round up the request size to a fixed size (mostly power
      of 2), so there could be a extra space than what is requested, whose
      size is the actual buffer size minus original request size.
      
      To better detect out of bound access or abuse of this space, add
      redzone sanity check for it.
      
      In current kernel, some kmalloc user already knows the existence of
      the space and utilizes it after calling 'ksize()' to know the real
      size of the allocated buffer. So we skip the sanity check for objects
      which have been called with ksize(), as treating them as legitimate
      users. Kees Cook is working on sanitizing all these user cases,
      by using kmalloc_size_roundup() to avoid ambiguous usages. And after
      this is done, this special handling for ksize() can be removed.
      
      In some cases, the free pointer could be saved inside the latter
      part of object data area, which may overlap the redzone part(for
      small sizes of kmalloc objects). As suggested by Hyeonggon Yoo,
      force the free pointer to be in meta data area when kmalloc redzone
      debug is enabled, to make all kmalloc objects covered by redzone
      check.
      Suggested-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Signed-off-by: default avatarFeng Tang <feng.tang@intel.com>
      Acked-by: default avatarHyeonggon Yoo <42.hyeyoo@gmail.com>
      Signed-off-by: default avatarVlastimil Babka <vbabka@suse.cz>
      946fa0db
  2. 10 Nov, 2022 2 commits
  3. 07 Nov, 2022 1 commit
  4. 06 Nov, 2022 1 commit
    • Kees Cook's avatar
      mm/slab_common: Restore passing "caller" for tracing · 32868715
      Kees Cook authored
      The "caller" argument was accidentally being ignored in a few places
      that were recently refactored. Restore these "caller" arguments, instead
      of _RET_IP_.
      
      Fixes: 11e9734b ("mm/slab_common: unify NUMA and UMA version of tracepoints")
      Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      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: Andrew Morton <akpm@linux-foundation.org>
      Cc: Roman Gushchin <roman.gushchin@linux.dev>
      Cc: linux-mm@kvack.org
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Acked-by: default avatarHyeonggon Yoo <42.hyeyoo@gmail.com>
      Signed-off-by: default avatarVlastimil Babka <vbabka@suse.cz>
      32868715
  5. 04 Nov, 2022 1 commit
  6. 03 Nov, 2022 1 commit
  7. 23 Oct, 2022 9 commits
  8. 22 Oct, 2022 21 commits
  9. 21 Oct, 2022 3 commits