#include <linux/mm.h>
#include <linux/hugetlb.h>
#include <linux/seq_file.h>
+#include <asm/elf.h>
#include <asm/uaccess.h>
char *task_mem(struct mm_struct *mm, char *buffer)
return size;
}
+#ifdef AT_SYSINFO_EHDR
+
+static struct vm_area_struct gate_vmarea = {
+ /* Do _not_ mark this area as readable, cuz not the entire range may be readable
+ (e.g., due to execute-only pages or holes) and the tools that read
+ /proc/PID/maps should read the interesting bits from the gate-DSO file
+ instead. */
+ .vm_start = FIXADDR_USER_START,
+ .vm_end = FIXADDR_USER_END
+};
+
+# define gate_map() &gate_vmarea
+#else
+# define gate_map() NULL
+#endif
+
static int show_map(struct seq_file *m, void *v)
{
struct vm_area_struct *map = v;
if (!map) {
up_read(&mm->mmap_sem);
mmput(mm);
+ if (l == -1)
+ map = gate_map();
}
return map;
}
static void m_stop(struct seq_file *m, void *v)
{
struct vm_area_struct *map = v;
- if (map) {
+ if (map && map != gate_map()) {
struct mm_struct *mm = map->vm_mm;
up_read(&mm->mmap_sem);
mmput(mm);
if (map->vm_next)
return map->vm_next;
m_stop(m, v);
+ if (map != gate_map())
+ return gate_map();
return NULL;
}