linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] mm/kmemleak: Simplify kmemleak_cond_resched() & fix UAF
@ 2022-12-10 23:00 Waiman Long
  2022-12-10 23:00 ` [PATCH 1/2] mm/kmemleak: Simplify kmemleak_cond_resched() usage Waiman Long
  2022-12-10 23:00 ` [PATCH 2/2] mm/kmemleak: Fix UAF bug in kmemleak_scan() Waiman Long
  0 siblings, 2 replies; 9+ messages in thread
From: Waiman Long @ 2022-12-10 23:00 UTC (permalink / raw)
  To: Catalin Marinas, Andrew Morton
  Cc: linux-mm, linux-kernel, Muchun Song, Waiman Long

It was found that a KASAN use-after-free error was reported in the
kmemleak_scan() function. After further examination, it is believe
that even though a reference is taken from the current object, it does
not prevent the object pointed to by the next pointer from going away
after a cond_resched(). So the heuristics is now changed to restart
scanning from the beginning of object_list in case the current object
is no longer in the object_list, i.e. OBJECT_ALLOCATED flag not set.

While making the change, I also simplify the current usage of
kmemleak_cond_resched() to make it easier to understand.

Waiman Long (2):
  mm/kmemleak: Simplify kmemleak_cond_resched() usage
  mm/kmemleak: Fix UAF bug in kmemleak_scan()

 mm/kmemleak.c | 59 ++++++++++++++++++++-------------------------------
 1 file changed, 23 insertions(+), 36 deletions(-)

-- 
2.31.1



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

end of thread, other threads:[~2022-12-23 17:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-10 23:00 [PATCH 0/2] mm/kmemleak: Simplify kmemleak_cond_resched() & fix UAF Waiman Long
2022-12-10 23:00 ` [PATCH 1/2] mm/kmemleak: Simplify kmemleak_cond_resched() usage Waiman Long
2022-12-14 10:43   ` Catalin Marinas
2022-12-10 23:00 ` [PATCH 2/2] mm/kmemleak: Fix UAF bug in kmemleak_scan() Waiman Long
2022-12-14 11:16   ` Catalin Marinas
2022-12-14 15:54     ` Waiman Long
2022-12-16 10:32       ` Catalin Marinas
2022-12-16 16:38         ` Waiman Long
2022-12-23 17:50           ` Catalin Marinas

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