projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
98e51a2
)
kernel/fork: assert no VMA readers during its destruction
author
Suren Baghdasaryan
<surenb@google.com>
Mon, 27 Feb 2023 17:36:19 +0000
(09:36 -0800)
committer
Andrew Morton
<akpm@linux-foundation.org>
Thu, 6 Apr 2023 03:02:59 +0000
(20:02 -0700)
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>
kernel/fork.c
patch
|
blob
|
history
diff --git
a/kernel/fork.c
b/kernel/fork.c
index 0907776d8ed43105e7e40ce1f50a46229ad42764..76fcc08984d4a0a7ba7acead9bd22349f23fcacd 100644
(file)
--- a/
kernel/fork.c
+++ b/
kernel/fork.c
@@
-491,6
+491,9
@@
static void vm_area_free_rcu_cb(struct rcu_head *head)
{
struct vm_area_struct *vma = container_of(head, struct vm_area_struct,
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);
}
#endif