The patch titled Subject: mm: make mem_dump_obj() handle NULL and zero-sized pointers has been added to the -mm tree. Its filename is mm-make-mem_dump_obj-handle-null-and-zero-sized-pointers.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/mm-make-mem_dump_obj-handle-null-and-zero-sized-pointers.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/mm-make-mem_dump_obj-handle-null-and-zero-sized-pointers.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: "Paul E. McKenney" <paulmck@xxxxxxxxxx> Subject: mm: make mem_dump_obj() handle NULL and zero-sized pointers This commit makes mem_dump_obj() call out NULL and zero-sized pointers specially instead of classifying them as non-paged memory. Link: https://lkml.kernel.org/r/20210106011750.13709-2-paulmck@xxxxxxxxxx Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxx> Acked-by: Vlastimil Babka <vbabka@xxxxxxx> Reported-by: Andrii Nakryiko <andrii@xxxxxxxxxx> Cc: Christoph Lameter <cl@xxxxxxxxx> Cc: Pekka Enberg <penberg@xxxxxxxxxx> Cc: David Rientjes <rientjes@xxxxxxxxxx> Cc: Joonsoo Kim <iamjoonsoo.kim@xxxxxxx> Cc: Jens Axboe <axboe@xxxxxxxxx> Cc: Ming Lei <ming.lei@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/util.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/mm/util.c~mm-make-mem_dump_obj-handle-null-and-zero-sized-pointers +++ a/mm/util.c @@ -997,7 +997,12 @@ int __weak memcmp_pages(struct page *pag void mem_dump_obj(void *object) { if (!virt_addr_valid(object)) { - pr_cont(" non-paged (local) memory.\n"); + if (object == NULL) + pr_cont(" NULL pointer.\n"); + else if (object == ZERO_SIZE_PTR) + pr_cont(" zero-size pointer.\n"); + else + pr_cont(" non-paged (local) memory.\n"); return; } if (kmem_valid_obj(object)) { _ Patches currently in -mm which might be from paulmck@xxxxxxxxxx are mm-add-mem_dump_obj-to-print-source-of-memory-block.patch mm-make-mem_dump_obj-handle-null-and-zero-sized-pointers.patch mm-make-mem_dump_obj-handle-vmalloc-memory.patch mm-make-mem_obj_dump-vmalloc-dumps-include-start-and-length.patch rcu-make-call_rcu-print-mem_dump_obj-info-for-double-freed-callback.patch percpu_ref-dump-mem_dump_obj-info-upon-reference-count-underflow.patch