]> git.baikalelectronics.ru Git - kernel.git/commit
mm: Hold a file reference in madvise_remove
authorAndy Lutomirski <luto@amacapital.net>
Thu, 5 Jul 2012 23:00:11 +0000 (16:00 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 6 Jul 2012 17:34:38 +0000 (10:34 -0700)
commitd1f1edc98e1b9d78c65868287632d671d7437092
treed69ebd5c2e2af1a2de34cc8abe2d57a4eebd35a5
parentbeb90747a5ef1e027cacc95a68972dd39e5b7069
mm: Hold a file reference in madvise_remove

Otherwise the code races with munmap (causing a use-after-free
of the vma) or with close (causing a use-after-free of the struct
file).

The bug was introduced by commit 835a9c08e88d ("[PATCH] holepunch: fix
mmap_sem i_mutex deadlock")

Cc: Hugh Dickins <hugh@veritas.com>
Cc: Miklos Szeredi <mszeredi@suse.cz>
Cc: Badari Pulavarty <pbadari@us.ibm.com>
Cc: Nick Piggin <npiggin@suse.de>
Cc: stable@vger.kernel.org
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/madvise.c