Re: [PATCH] proc: calculate and initialize size of /proc/<PID>/auxv

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 17, 2011 at 12:19:40PM +0900, Takayuki Nagata wrote:
> An ls and a wc commands show 0 size for some of /proc/<PID>/*
> files, because getattr methods and inode->i_size variables
> are not implemented for these files. These files are known
> pseudo, but some peoples may need size of the files.

"Some people may need" is far to vague...

> BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=155943

Containing unanswered question by mingo, again along the lines of "WTF is
that needed at all?"...

> +static int proc_pid_auxv(struct task_struct *task, char *buffer)
> +{
> +	int size;
> +	struct mm_struct *mm = get_task_mm(task);
> +	size = count_mm_saved_auxv(mm);
> +	if (mm) {
> +		if(buffer)
> +			memcpy(buffer, mm->saved_auxv, size);
> +		mmput(mm);
> +	}

Oh, lovely - so we are allowing anybody to read it, suid exec be damned.

> +static loff_t proc_pid_auxv_isize(struct task_struct *task)
> +{
> +	struct mm_struct *mm = get_task_mm(task);
> +	return count_mm_saved_auxv(mm);

... and that simply leaks.

> +static int proc_pid_auxv_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
> +{
> +	struct inode *inode = dentry->d_inode;
> +	struct task_struct *task = get_proc_task(inode);
> +	struct mm_struct *mm = get_task_mm(task);
> +
> +	generic_fillattr(inode, stat);
> +	stat->size = count_mm_saved_auxv(mm);

... and so does this, both mm and task.

Ancient bz entry with unanswered objections in it, broken patch, no
rationale in sight... NAK with extreme prejudice.
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux