]> git.baikalelectronics.ru Git - kernel.git/commit
proc: check vma->vm_file before dereferencing
authorStanislav Kinsbursky <skinsbursky@parallels.com>
Tue, 27 Nov 2012 00:29:42 +0000 (16:29 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 27 Nov 2012 01:41:24 +0000 (17:41 -0800)
commitaca1f3e8e3075304085c0940de5d777844aaa71f
treeeaab16738a3d405084466d5a9aca01db37e41f73
parent1803f64fd935b5d77379340a10b87e67d7ebe2df
proc: check vma->vm_file before dereferencing

Commit 79ca82bc87fe ("proc_map_files_readdir(): don't bother with
grabbing files") switched proc_map_files_readdir() to use @f_mode
directly instead of grabbing @file reference, but same time the test for
@vm_file presence was lost leading to nil dereference.  The patch brings
the test back.

The all proc_map_files feature is CONFIG_CHECKPOINT_RESTORE wrapped
(which is set to 'n' by default) so the bug doesn't affect regular
kernels.

The regression is 3.7-rc1 only as far as I can tell.

[gorcunov@openvz.org: provided changelog]
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/proc/base.c