OSDN Git Service

mm: Convert check_heap_object() to use struct slab
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 4 Oct 2021 13:45:56 +0000 (14:45 +0100)
committerVlastimil Babka <vbabka@suse.cz>
Thu, 6 Jan 2022 11:25:51 +0000 (12:25 +0100)
commit0b3eb091d5759479d44cb793fad2c51ea06bdcec
tree00a317cba0a53dc099678ebb16dcec3a4be41539
parent7213230af5e1e83ff010b3448260b9d3f95dd036
mm: Convert check_heap_object() to use struct slab

Ensure that we're not seeing a tail page inside __check_heap_object() by
converting to a slab instead of a page.  Take the opportunity to mark
the slab as const since we're not modifying it.  Also move the
declaration of __check_heap_object() to mm/slab.h so it's not available
to the wider kernel.

[ vbabka@suse.cz: in check_heap_object() only convert to struct slab for
  actual PageSlab pages; use folio as intermediate step instead of page ]

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Reviewed-by: Roman Gushchin <guro@fb.com>
include/linux/slab.h
mm/slab.c
mm/slab.h
mm/slub.c
mm/usercopy.c