X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=fs%2Fproc%2Ftask_nommu.c;h=d8b8c7183c243d86455390f1246da6c12891d396;hb=821f3eff7cdb9d6c7076effabd46c96c322daed1;hp=fcc5caf93f554594aa3a9873abef5c22b67abfa6;hpb=cfee47f99bc14a6d7c6b0be2284db2cef310a815;p=linux-2.6 diff --git a/fs/proc/task_nommu.c b/fs/proc/task_nommu.c index fcc5caf93f..d8b8c7183c 100644 --- a/fs/proc/task_nommu.c +++ b/fs/proc/task_nommu.c @@ -2,6 +2,7 @@ #include #include #include +#include #include #include "internal.h" @@ -143,6 +144,12 @@ out: static int show_map(struct seq_file *m, void *_vml) { struct vm_list_struct *vml = _vml; + struct proc_maps_private *priv = m->private; + struct task_struct *task = priv->task; + + if (maps_protect && !ptrace_may_attach(task)) + return -EACCES; + return nommu_vma_show(m, vml->vma); } @@ -220,7 +227,7 @@ static int maps_open(struct inode *inode, struct file *file) return ret; } -struct file_operations proc_maps_operations = { +const struct file_operations proc_maps_operations = { .open = maps_open, .read = seq_read, .llseek = seq_lseek,