[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4E5680D2.1030608@parallels.com>
Date: Thu, 25 Aug 2011 21:05:22 +0400
From: Pavel Emelyanov <xemul@...allels.com>
To: Tejun Heo <tj@...nel.org>
CC: Cyrill Gorcunov <gorcunov@...il.com>,
Vasiliy Kulikov <segoon@...nwall.com>,
Nathan Lynch <ntl@...ox.com>,
Oren Laadan <orenl@...columbia.edu>,
Daniel Lezcano <dlezcano@...ibm.com>,
Andrew Morton <akpm@...ux-foundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
James Bottomley <jbottomley@...allels.com>,
LINUXFS-ML <linux-fsdevel@...r.kernel.org>,
"containers@...ts.osdl.org" <containers@...ts.osdl.org>,
Zan Lynx <zlynx@....org>, Andi Kleen <andi@...stfloor.org>
Subject: Re: [RFC] fs, proc: Introduce the /proc/<pid>/map_files/ directory
v2
On 08/25/2011 09:01 PM, Tejun Heo wrote:
> Hello,
>
> On Thu, Aug 25, 2011 at 12:29:44PM +0400, Cyrill Gorcunov wrote:
>> | lr-x------ 1 cyrill cyrill 64 Aug 9 15:25 0x3d73a00000 -> /lib64/ld-2.5.so
>> | lr-x------ 1 cyrill cyrill 64 Aug 9 15:25 0x3d73c1b000 -> /lib64/ld-2.5.so
>> | lr-x------ 1 cyrill cyrill 64 Aug 9 15:25 0x3d73c1c000 -> /lib64/ld-2.5.so
>> | lr-x------ 1 cyrill cyrill 64 Aug 9 15:25 0x3d73e00000 -> /lib64/libc-2.5.so
>> | lr-x------ 1 cyrill cyrill 64 Aug 9 15:25 0x3d73f4e000 -> /lib64/libc-2.5.so
>
> I would prefer if the filename included both start and end addresses
> so that it matches the first column of /proc/PID/maps and ls'ing the
> directory is more useful. What do other people think?
Without 0x at the beginning this is not very convenient, but once we add them it no
longer matches the contents of the /proc/pid/maps.
Just an opinion, do not mind adding <end> to the name.
>> +static int map_files_d_revalidate(struct dentry *dentry, struct nameidata *nd)
>> +{
>> + struct task_struct *task;
>> + struct vm_area_struct *vma;
>> + struct mm_struct *mm;
>> + struct inode *inode;
>> +
>> + if (nd && nd->flags & LOOKUP_RCU)
>> + return -ECHILD;
>> +
>> + inode = dentry->d_inode;
>> + task = get_proc_task(inode);
>> + if (!task)
>> + goto out;
>> +
>> + mm = get_task_mm(task);
>> + put_task_struct(task);
>> + if (!mm)
>> + goto out;
>> +
>> + down_read(&mm->mmap_sem);
>> + vma = find_exact_vma(mm, PROC_I(inode)->vm_start);
>> + up_read(&mm->mmap_sem);
>> + mmput(mm);
>> +
>> + if (vma)
>> + return 1;
>
> Hmm... don't we need the same credential update as
> tid_fd_revalidate()? If the task seteuid's, we want the permissions
> to change accordingly, right?
>
> Thanks.
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists