]> git.karo-electronics.de Git - karo-tx-linux.git/commit
proc: check vma->vm_file before dereferencing
authorStanislav Kinsbursky <skinsbursky@parallels.com>
Fri, 9 Nov 2012 03:03:43 +0000 (14:03 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 12 Nov 2012 03:57:36 +0000 (14:57 +1100)
commitecce65c252e42a663be08bee77277c364097fc9b
tree05e16ee1dfda3cf5daa5f908bcf7291e63fdd38f
parent3b626ef83cbb8ce6213f3e613039eb64416c948d
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