cooperative-computing-lab/cctools — pull request #597 by batrick (2014-11-07 22:06:03+00:00)
Title: Translate /proc/pid/maps entries to Parrot files.

Previously, Parrot would allow the real /proc/pid/maps to be read by the
tracee:

$ ./parrot/src/parrot_run -- /bin/sh -c 'cat /proc/self/maps'
2014/11/07 13:43:40.97 parrot_run[17941] notice: parrot_run 4.3.0 has not been tested on Linux 3.17.2-1-ARCH yet, this may not work
00400000-0040c000 r-xp 00000000 08:05 138107 /usr/bin/cat
0060b000-0060c000 r--p 0000b000 08:05 138107 /usr/bin/cat
0060c000-0060d000 rw-p 0000c000 08:05 138107 /usr/bin/cat
00640000-00661000 rw-p 00000000 00:00 0 [heap]
7f9dee799000-7f9deeb98000 r--p 00212000 00:11 377681 /dev/shm/parrot-channel.hBPJ43 (deleted)
7f9deeb98000-7f9deed31000 r-xp 0002d000 00:11 377681 /dev/shm/parrot-channel.hBPJ43 (deleted)
7f9deed31000-7f9deef31000 ---p 001c6000 00:11 377681 /dev/shm/parrot-channel.hBPJ43 (deleted)
7f9deef31000-7f9deef35000 r--p 001c6000 00:11 377681 /dev/shm/parrot-channel.hBPJ43 (deleted)
7f9deef35000-7f9deef37000 rw-p 001ca000 00:11 377681 /dev/shm/parrot-channel.hBPJ43 (deleted)
7f9deef37000-7f9deef3b000 rw-p 00000000 00:00 0
7f9deef3b000-7f9deef5d000 r-xp 00000000 08:05 140227 /usr/lib/ld-2.20.so
7f9def11a000-7f9def13f000 rw-p 00000000 00:00 0
7f9def15c000-7f9def15d000 r--p 00021000 08:05 140227 /usr/lib/ld-2.20.so
7f9def15d000-7f9def15e000 rw-p 00022000 08:05 140227 /usr/lib/ld-2.20.so
7f9def15e000-7f9def15f000 rw-p 00000000 00:00 0
7fffbea3a000-7fffbea5b000 rw-p 00000000 00:00 0 [stack]
7fffbeaa6000-7fffbeaa8000 r--p 00000000 00:00 0 [vvar]
7fffbeaa8000-7fffbeaaa000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]

Which is leaking the presence of the channel to the tracee. That by itself is
not a big deal but OpenCL uses paths in the memory mappings to locate
configuration files. So, Parrot needs to give the "real" path back to the
application when reading this file.

Fixes #596.