]> git.baikalelectronics.ru Git - kernel.git/commit
mm: set vm_next and vm_prev to NULL in vm_area_dup()
authorLi Xinhai <lixinhai.lxh@gmail.com>
Tue, 7 Apr 2020 03:03:39 +0000 (20:03 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 7 Apr 2020 17:43:37 +0000 (10:43 -0700)
commitcc3a8257ea15d1a3474d3cf0f9056bc211d95885
treebb60f7247fc676a15dacb899ca15a02881535877
parent9fc384190c7495031ce3c4a04dc6181c74adec4d
mm: set vm_next and vm_prev to NULL in vm_area_dup()

Set ->vm_next and ->vm_prev to NULL to prevent potential misuse from the
new duplicated vma.

Currently, only in fork path there are misuse for handling anon_vma.  No
other bugs been revealed with this patch applied.

Signed-off-by: Li Xinhai <lixinhai.lxh@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Rik van Riel <riel@redhat.com>
Link: http://lkml.kernel.org/r/1581150928-3214-4-git-send-email-lixinhai.lxh@gmail.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/fork.c