From: Andy Lutomirski Date: Thu, 5 Jul 2012 23:00:11 +0000 (-0700) Subject: mm: Hold a file reference in madvise_remove X-Git-Tag: v3.5-rc6~7 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ab4233dd08036fe34a89c7dc6f47a8bf2eb29eb;p=pandora-kernel.git 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 90ed52ebe481 ("[PATCH] holepunch: fix mmap_sem i_mutex deadlock") Cc: Hugh Dickins Cc: Miklos Szeredi Cc: Badari Pulavarty Cc: Nick Piggin Cc: stable@vger.kernel.org Signed-off-by: Andy Lutomirski Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed