• Kees Cook's avatar
    mm/slub: clarify verification reporting · 8669dbab
    Kees Cook authored
    Patch series "Actually fix freelist pointer vs redzoning", v4.
    
    This fixes redzoning vs the freelist pointer (both for middle-position
    and very small caches).  Both are "theoretical" fixes, in that I see no
    evidence of such small-sized caches actually be used in the kernel, but
    that's no reason to let the bugs continue to exist, especially since
    people doing local development keep tripping over it.  :)
    
    This patch (of 3):
    
    Instead of repeating "Redzone" and "Poison", clarify which sides of
    those zones got tripped.  Additionally fix column alignment in the
    trailer.
    
    Before:
    
      BUG test (Tainted: G    B            ): Redzone overwritten
      ...
      Redzone (____ptrval____): bb bb bb bb bb bb bb bb      ........
      Object (____ptrval____): f6 f4 a5 40 1d e8            ...@..
      Redzone (____ptrval____): 1a aa                        ..
      Padding (____ptrval____): 00 00 00 00 00 00 00 00      ........
    
    After:
    
      BUG test (Tainted: G    B            ): Right Redzone overwritten
      ...
      Redzone  (____ptrval____): bb bb bb bb bb bb bb bb      ........
      Object   (____ptrval____): f6 f4 a5 40 1d e8            ...@..
      Redzone  (____ptrval____): 1a aa                        ..
      Padding  (____ptrval____): 00 00 00 00 00 00 00 00      ........
    
    The earlier commits that slowly resulted in the "Before" reporting were:
    
      d86bd1be ("mm/slub: support left redzone")
      ffc79d28 ("slub: use print_hex_dump")
      24922684 ("SLUB: change error reporting format to follow lockdep loosely")
    
    Link: https://lkml.kernel.org/r/20210608183955.280836-1-keescook@chromium.org
    Link: https://lkml.kernel.org/r/20210608183955.280836-2-keescook@chromium.org
    Link: https://lore.kernel.org/lkml/cfdb11d7-fb8e-e578-c939-f7f5fb69a6bd@suse.cz/Signed-off-by: default avatarKees Cook <keescook@chromium.org>
    Acked-by: default avatarVlastimil Babka <vbabka@suse.cz>
    Cc: Marco Elver <elver@google.com>
    Cc: "Lin, Zhenpeng" <zplin@psu.edu>
    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: Roman Gushchin <guro@fb.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    8669dbab
slub.rst 14.2 KB