1. 14 Jul, 2023 2 commits
    • Vlastimil Babka's avatar
      mm/slub: remove freelist_dereference() · 1662b6c2
      Vlastimil Babka authored
      freelist_dereference() is a one-liner only used from get_freepointer().
      Remove it and make get_freepointer() call freelist_ptr_decode()
      directly to make the code easier to follow.
      Signed-off-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Acked-by: default avatarKees Cook <keescook@chromium.org>
      1662b6c2
    • Vlastimil Babka's avatar
      mm/slub: remove redundant kasan_reset_tag() from freelist_ptr calculations · b06952cd
      Vlastimil Babka authored
      Commit d36a63a9 ("kasan, slub: fix more conflicts with
      CONFIG_SLAB_FREELIST_HARDENED") has introduced kasan_reset_tags() to
      freelist_ptr() encoding/decoding when CONFIG_SLAB_FREELIST_HARDENED is
      enabled to resolve issues when passing tagged or untagged pointers
      inconsistently would lead to incorrect calculations.
      
      Later, commit aa1ef4d7 ("kasan, mm: reset tags when accessing
      metadata") made sure all pointers have tags reset regardless of
      CONFIG_SLAB_FREELIST_HARDENED, because there was no other way to access
      the freepointer metadata safely with hw tag-based KASAN.
      
      Therefore the kasan_reset_tag() usage in freelist_ptr_encode()/decode()
      is now redundant, as all callers use kasan_reset_tag() unconditionally
      when constructing ptr_addr. Remove the redundant calls and simplify the
      code and remove obsolete comments.
      
      Also in freelist_ptr_encode() introduce an 'encoded' variable to make
      the lines shorter and make it similar to the _decode() one.
      Signed-off-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Reviewed-by: default avatarAndrey Konovalov <andreyknvl@gmail.com>
      Acked-by: default avatarKees Cook <keescook@chromium.org>
      b06952cd
  2. 11 Jul, 2023 1 commit
  3. 09 Jul, 2023 10 commits
  4. 08 Jul, 2023 27 commits