aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Chagin <dchagin@FreeBSD.org>2015-05-24 17:44:42 +0000
committerDmitry Chagin <dchagin@FreeBSD.org>2015-05-24 17:44:42 +0000
commitffefd5707d894f4dc01d0d1fa8f3ed5d3c7ff124 (patch)
tree033a8af531e08aa3f9a2fee52397897ffc47b0cd
parenta7ac45761335b1d514804cd0bfe44bdb2c3a3e0c (diff)
downloadsrc-ffefd5707d894f4dc01d0d1fa8f3ed5d3c7ff124.tar.gz
src-ffefd5707d894f4dc01d0d1fa8f3ed5d3c7ff124.zip
Add vdso and stack names to the /proc/self/maps.
Notes
Notes: svn path=/head/; revision=283472
-rw-r--r--sys/compat/linprocfs/linprocfs.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c
index 000e1226036d..ee031d03bf02 100644
--- a/sys/compat/linprocfs/linprocfs.c
+++ b/sys/compat/linprocfs/linprocfs.c
@@ -978,6 +978,8 @@ linprocfs_doprocenviron(PFS_FILL_ARGS)
static char l32_map_str[] = "%08lx-%08lx %s%s%s%s %08lx %02x:%02x %lu%s%s\n";
static char l64_map_str[] = "%016lx-%016lx %s%s%s%s %08lx %02x:%02x %lu%s%s\n";
+static char vdso_str[] = " [vdso]";
+static char stack_str[] = " [stack]";
/*
* Filler function for proc/pid/maps
@@ -1014,6 +1016,11 @@ linprocfs_doprocmaps(PFS_FILL_ARGS)
vm = vmspace_acquire_ref(p);
if (vm == NULL)
return (ESRCH);
+
+ if (SV_CURPROC_FLAG(SV_LP64))
+ l_map_str = l64_map_str;
+ else
+ l_map_str = l32_map_str;
map = &vm->vm_map;
vm_map_lock_read(map);
for (entry = map->header.next; entry != &map->header;
@@ -1056,6 +1063,11 @@ linprocfs_doprocmaps(PFS_FILL_ARGS)
VOP_GETATTR(vp, &vat, td->td_ucred);
ino = vat.va_fileid;
vput(vp);
+ } else if (SV_PROC_ABI(p) == SV_ABI_LINUX) {
+ if (e_start == p->p_sysent->sv_shared_page_base)
+ name = vdso_str;
+ if (e_end == p->p_sysent->sv_usrstack)
+ name = stack_str;
}
} else {
flags = 0;
@@ -1067,10 +1079,6 @@ linprocfs_doprocmaps(PFS_FILL_ARGS)
* format:
* start, end, access, offset, major, minor, inode, name.
*/
- if (SV_CURPROC_FLAG(SV_LP64))
- l_map_str = l64_map_str;
- else
- l_map_str = l32_map_str;
error = sbuf_printf(sb, l_map_str,
(u_long)e_start, (u_long)e_end,
(e_prot & VM_PROT_READ)?"r":"-",