criu/pie
Cyrill Gorcunov d1db4faf9b vdso: Don't fail if pagemap is not accessbile
We use page frame number to detect vDSO which has been remapped
in-place from runtime vDSO during restore. In such case if the
kernel is younger than 3.16 the "[vdso]" mark won't be reported
in procfs output.

Still to address recently reported CVEs and be able to run CRIU
in unprivileged mode we need to handle vDSO without pagemap access
and here is the deal -- when we find VMA which "looks like" vDSO
we try to scan it for vDSO symbols and if it matches we restore
its status without PFN access.

Here is some details on @pagemap access in-kernel history:

 - @pagemap introduced in commit 85863e475e59 where anyone
   which can attach to a task via ptrace is allowed to read
   data from @pagemap (Feb 4 2008, v2.6.25-rc1)

 - in commit 006ebb40d3d65 ptrace attach rule has been changed
   into ptrace read permission (May 19 2008, v2.6.27-rc1)

 - in commit ab676b7d6fbf4 opening of @pagemap become guarded
   with CAP_SYS_ADMIN because of leak of physical addresses
   into userspace (Mar 9 2015, v4.0-rc5)

 - in commit 1c90308e7a77a opening of @pagemap become available
   for regular users again (with ptrace read permission) but
   physical addresses of pages are hidden from non-privileged
   userd (Sep 8 2015, v4.3-rc1)

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Looks-good-to-me: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-12-24 14:40:05 +03:00
..
piegen Append newline when using pr_err() 2015-10-09 18:28:00 +03:00
log-simple.c pie: Support %p printing 2015-11-05 15:34:48 +03:00
Makefile Build pie objects separately 2015-10-14 15:53:07 +03:00
parasite-vdso.c vdso: Rework vdso processing files 2015-09-10 14:07:22 +03:00
parasite.c vdso: Don't fail if pagemap is not accessbile 2015-12-24 14:40:05 +03:00
pie-reloc.lds.S.in ppc64: pie -- Move the TOC in its own section 2015-06-08 23:53:29 +03:00
pie-relocs.c pie: piegen -- Slightly rework the building procedure 2015-06-08 23:53:27 +03:00
pie-relocs.h Use run-time page_size() in pie_size() 2015-07-28 13:38:20 +03:00
pie.lds.S.in arch/ppc64: Add PowerPC 64 LE support 2015-04-30 09:57:49 +03:00
restorer.c creds: restore -- Implement per-thread restore of credentials 2015-12-24 13:20:58 +03:00
util-fd.c util-fd: Use standard BUG_ON instead of hand-made 2015-03-04 17:50:06 +03:00
util-vdso.c pie: Give VDSO symbol table local scope 2015-10-05 13:21:16 +03:00
util.c criu: Drop redundant newline from pr_perror 2014-08-22 19:22:39 +04:00