]> git.baikalelectronics.ru Git - kernel.git/commit
mm/kmemleak: prevent soft lockup in kmemleak_scan()'s object iteration loops
authorWaiman Long <longman@redhat.com>
Thu, 20 Oct 2022 17:56:19 +0000 (13:56 -0400)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 28 Oct 2022 20:37:22 +0000 (13:37 -0700)
commit362cd5f89ab1da0fc106a20f0622d3ad150a324d
tree83d57ad3c8479ecb6048afb0472cd32cfadb7a21
parent68e607e9ae92194639711f16fe8b2b73cb818b8a
mm/kmemleak: prevent soft lockup in kmemleak_scan()'s object iteration loops

Commit 918a25c5c6dd ("mm/kmemleak: prevent soft lockup in first object
iteration loop of kmemleak_scan()") adds cond_resched() in the first
object iteration loop of kmemleak_scan().  However, it turns that the 2nd
objection iteration loop can still cause soft lockup to happen in some
cases.  So add a cond_resched() call in the 2nd and 3rd loops as well to
prevent that and for completeness.

Link: https://lkml.kernel.org/r/20221020175619.366317-1-longman@redhat.com
Fixes: 918a25c5c6dd ("mm/kmemleak: prevent soft lockup in first object iteration loop of kmemleak_scan()")
Signed-off-by: Waiman Long <longman@redhat.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Muchun Song <songmuchun@bytedance.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/kmemleak.c