mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
UPSTREAM: kernel/fork: assert no VMA readers during its destruction
Assert there are no holders of VMA lock for reading when it is about to be
destroyed.
Link: https://lkml.kernel.org/r/20230227173632.3292573-21-surenb@google.com
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
(cherry picked from commit f2e13784c1)
Bug: 161210518
Change-Id: I67fc318fd08575c9bcc54fd00b0304246b0cd279
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
This commit is contained in:
committed by
Carlos Llamas
parent
9cc64c7fb9
commit
3d18d86ea9
@@ -498,6 +498,9 @@ static void vm_area_free_rcu_cb(struct rcu_head *head)
|
|||||||
{
|
{
|
||||||
struct vm_area_struct *vma = container_of(head, struct vm_area_struct,
|
struct vm_area_struct *vma = container_of(head, struct vm_area_struct,
|
||||||
vm_rcu);
|
vm_rcu);
|
||||||
|
|
||||||
|
/* The vma should not be locked while being destroyed. */
|
||||||
|
VM_BUG_ON_VMA(rwsem_is_locked(&vma->lock), vma);
|
||||||
__vm_area_free(vma);
|
__vm_area_free(vma);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user