What do the "--- p" permissions in / proc / self / maps mean?

I understand the meaning of the rwxps bit. r-xp for .text. rw-p for .data / .bss / heap / stack. What is the use of just pages ---p ?

For example, see this output cat /proc/self/maps

 00400000-0040b000 r-xp 00000000 08:03 827490 / bin / cat
 0060b000-0060c000 rw-p 0000b000 08:03 827490 / bin / cat
 0060c000-0062d000 rw-p 00000000 00:00 0 [heap]
 3819a00000-3819a1e000 r-xp 00000000 08:03 532487 / lib64 ld-2.11.2.so
 3819c1d000-3819c1e000 r - p 0001d000 08:03 532487 /lib64/ld-2.11.2.so
 3819c1e000-3819c1f000 rw-p 0001e000 08:03 532487 /lib64/ld-2.11.2.so
 3819c1f000-3819c20000 rw-p 00000000 00:00 0 
 3819e00000-3819f70000 r-xp 00000000 08:03 532490 /lib64/libc-2.11.2.so
 3819f70000-381a16f000 --- p 00170000 08:03 532490 /lib64/libc-2.11.2.so
 381a16f000-381a173000 r - p 0016f000 08:03 532490 /lib64/libc-2.11.2.so
 381a173000-381a174000 rw-p 00173000 08:03 532490 /lib64/libc-2.11.2.so
 381a174000-381a179000 rw-p 00000000 00:00 0 
 7fb859c49000-7fb85fa7a000 r - p 00000000 08:03 192261 / usr / lib / locale / locale-archive
 7fb85fa7a000-7fb85fa7d000 rw-p 00000000 00:00 0 
 7fb85fa95000-7fb85fa96000 rw-p 00000000 00:00 0
 7fff64894000-7fff648a9000 rw-p 00000000 00:00 0 [stack]
 7fff649ff000-7fff64a00000 r-xp 00000000 00:00 0 [vdso]
 ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
+7
linux memory permissions shared-libraries memory-mapping
source share
2 answers

According to the man page , this means that it is personal (copy-on-write). I do not know what the use of such a comparison does not allow to read / write / perform anything in it.

It may be private to libc, allowing it to change permissions to access it without using a user program that accidentally deletes it.

+1
source share

This is what I also thought about. It has not appeared until the last few years, but I'm not sure if it is responsible for changing GNU binutils or the dynamic linker glibc ( ld-linux.so.2 ).

At first I thought it was a kind of security area created by the dynamic linker to protect against access outside the access to the library data segment, but it makes no sense to be so big. It is possible that this is a complete map of the while library file so that the dynamic linker can make it readable again in the future (possibly during dlopen or dlsym calls) to access ELF metadata that is not normally needed for display.

In any case, this is an unpleasant bloat, especially on 32-bit machines, where virtual address space is a valuable resource. It also inflates the kernel page tables, increasing the kernel resources used by the process.

PS Sorry, this is not really the answer. I know that these are just random snippets that can help lead to an answer, but too late for comment.

0
source share

All Articles