]> git.karo-electronics.de Git - karo-tx-linux.git/commit
proc: check vma->vm_file before dereferencing
authorStanislav Kinsbursky <skinsbursky@parallels.com>
Thu, 25 Oct 2012 01:14:34 +0000 (12:14 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 30 Oct 2012 04:15:04 +0000 (15:15 +1100)
commit8d92aff7a02538c2ae036b0d2e6ec4d59130820c
tree41ade397a4e31f6d85df3581d03f8e14f6c7e5f3
parent7de7fe8087f35398e5ba6b4d415ccb69e7ca2908
proc: check vma->vm_file before dereferencing

7b540d0646ce ("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_\10CHECKPOINT_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>
fs/proc/base.c