diff options
author | Andy Lutomirski <luto@amacapital.net> | 2012-07-05 16:00:11 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-07-16 09:04:43 -0700 |
commit | 0c4ad5cc8c01f62fe5211b5ce9563c27f795a4ab (patch) | |
tree | a387acf3d19362ad7812134b3fdff5eb81f92c4a /block | |
parent | c9bb51fb8c7a9d8b230c0bd184d9af919350383b (diff) | |
download | lwn-0c4ad5cc8c01f62fe5211b5ce9563c27f795a4ab.tar.gz lwn-0c4ad5cc8c01f62fe5211b5ce9563c27f795a4ab.zip |
mm: Hold a file reference in madvise_remove
commit 9ab4233dd08036fe34a89c7dc6f47a8bf2eb29eb upstream.
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 <hugh@veritas.com>
Cc: Miklos Szeredi <mszeredi@suse.cz>
Cc: Badari Pulavarty <pbadari@us.ibm.com>
Cc: Nick Piggin <npiggin@suse.de>
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[bwh: Backported to 3.2:
- Adjust context
- madvise_remove() calls vmtruncate_range(), not do_fallocate()]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'block')
0 files changed, 0 insertions, 0 deletions