|
@@ -261,13 +261,31 @@ static int do_maps_open(struct inode *inode, struct file *file,
|
|
|
sizeof(struct proc_maps_private));
|
|
|
}
|
|
|
|
|
|
+static pid_t pid_of_stack(struct proc_maps_private *priv,
|
|
|
+ struct vm_area_struct *vma, bool is_pid)
|
|
|
+{
|
|
|
+ struct inode *inode = priv->inode;
|
|
|
+ struct task_struct *task;
|
|
|
+ pid_t ret = 0;
|
|
|
+
|
|
|
+ rcu_read_lock();
|
|
|
+ task = pid_task(proc_pid(inode), PIDTYPE_PID);
|
|
|
+ if (task) {
|
|
|
+ task = task_of_stack(task, vma, is_pid);
|
|
|
+ if (task)
|
|
|
+ ret = task_pid_nr_ns(task, inode->i_sb->s_fs_info);
|
|
|
+ }
|
|
|
+ rcu_read_unlock();
|
|
|
+
|
|
|
+ return ret;
|
|
|
+}
|
|
|
+
|
|
|
static void
|
|
|
show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid)
|
|
|
{
|
|
|
struct mm_struct *mm = vma->vm_mm;
|
|
|
struct file *file = vma->vm_file;
|
|
|
struct proc_maps_private *priv = m->private;
|
|
|
- struct task_struct *task = priv->task;
|
|
|
vm_flags_t flags = vma->vm_flags;
|
|
|
unsigned long ino = 0;
|
|
|
unsigned long long pgoff = 0;
|
|
@@ -332,8 +350,7 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid)
|
|
|
goto done;
|
|
|
}
|
|
|
|
|
|
- tid = vm_is_stack(task, vma, is_pid);
|
|
|
-
|
|
|
+ tid = pid_of_stack(priv, vma, is_pid);
|
|
|
if (tid != 0) {
|
|
|
/*
|
|
|
* Thread stack in /proc/PID/task/TID/maps or
|
|
@@ -1446,7 +1463,7 @@ static int show_numa_map(struct seq_file *m, void *v, int is_pid)
|
|
|
} else if (vma->vm_start <= mm->brk && vma->vm_end >= mm->start_brk) {
|
|
|
seq_puts(m, " heap");
|
|
|
} else {
|
|
|
- pid_t tid = vm_is_stack(task, vma, is_pid);
|
|
|
+ pid_t tid = pid_of_stack(proc_priv, vma, is_pid);
|
|
|
if (tid != 0) {
|
|
|
/*
|
|
|
* Thread stack in /proc/PID/task/TID/maps or
|