linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/9] mm: kmemleak: fix unreported memory leaks
@ 2023-01-23 17:04 George Prekas
  2023-01-23 17:04 ` [PATCH 1/9] mm: kmemleak: properly disable task stack scanning George Prekas
                   ` (8 more replies)
  0 siblings, 9 replies; 19+ messages in thread
From: George Prekas @ 2023-01-23 17:04 UTC (permalink / raw)
  To: linux-kernel, linux-mm
  Cc: Catalin Marinas, Andrew Morton, Christoph Lameter, Pekka Enberg,
	David Rientjes, Joonsoo Kim, Vlastimil Babka, Roman Gushchin,
	Hyeonggon Yoo, Thomas Gleixner, Eric W. Biederman,
	Sebastian Andrzej Siewior, Andy Lutomirski, Peter Zijlstra,
	Liam R. Howlett, Fenghua Yu, Andrei Vagin, George Prekas

Fix a couple of issues with kmemleak that lead to missed (not reported)
leaks. Parts of the kernel keep references to allocated objects which
are not properly communicated to kmemleak. This causes kmemleak to fail
to report some memory leaks.

I have also written a kmemleak test. It is a userspace Python script
and a device driver that communicate over ioctl, allocate and free
memory and verify that memory leaks are reported correctly. You can find
it here:

https://gist.github.com/george-enf/2d7cc288202b94defbe253f4ca26357b

George Prekas (9):
  mm: kmemleak: properly disable task stack scanning
  Revert "mm/kmemleak: make create_object return void"
  mm: kmemleak: propagate NO_SCAN flag in delete_object_part
  mm: kmemleak: add kmemleak_noscan_phys function
  mm: kmemleak: do not scan sparsemap_buf
  mm: kmemleak: do not scan cpu_cache of struct kmem_cache
  mm: kmemleak: erase page->s_mem in slab_destroy
  mm: kmemleak: erase page->freelist in slab_destroy
  mm: kmemleak: fix undetected leaks for page aligned objects

 include/linux/kmemleak.h |  5 ++
 kernel/fork.c            |  3 ++
 mm/kmemleak.c            | 98 ++++++++++++++++++++++++++--------------
 mm/slab.c                | 20 +++-----
 mm/slab.h                |  7 ++-
 mm/sparse.c              |  3 ++
 6 files changed, 88 insertions(+), 48 deletions(-)

-- 
2.37.1



^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2023-02-01 15:39 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-23 17:04 [PATCH 0/9] mm: kmemleak: fix unreported memory leaks George Prekas
2023-01-23 17:04 ` [PATCH 1/9] mm: kmemleak: properly disable task stack scanning George Prekas
2023-01-24  0:39   ` kernel test robot
2023-01-24  5:46   ` kernel test robot
2023-01-24  5:57   ` kernel test robot
2023-01-24  6:07   ` kernel test robot
2023-01-25 14:47   ` Catalin Marinas
2023-02-01 15:38   ` kernel test robot
2023-01-23 17:04 ` [PATCH 2/9] Revert "mm/kmemleak: make create_object return void" George Prekas
2023-01-23 17:04 ` [PATCH 3/9] mm: kmemleak: propagate NO_SCAN flag in delete_object_part George Prekas
2023-01-23 17:04 ` [PATCH 4/9] mm: kmemleak: add kmemleak_noscan_phys function George Prekas
2023-01-23 17:04 ` [PATCH 5/9] mm: kmemleak: do not scan sparsemap_buf George Prekas
2023-01-23 17:04 ` [PATCH 6/9] mm: kmemleak: do not scan cpu_cache of struct kmem_cache George Prekas
2023-01-23 17:04 ` [PATCH 7/9] mm: kmemleak: erase page->s_mem in slab_destroy George Prekas
2023-01-26 11:28   ` Christoph Lameter
2023-01-23 17:04 ` [PATCH 8/9] mm: kmemleak: erase page->freelist " George Prekas
2023-01-23 17:04 ` [PATCH 9/9] mm: kmemleak: fix undetected leaks for page aligned objects George Prekas
2023-01-24 16:16   ` Matthew Wilcox
2023-01-26 11:21   ` Christoph Lameter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox