Re: [PATCH] Call security hook from pid*_revalidate

From: OGAWA Hirofumi
Date: Wed Aug 20 2003 - 10:03:50 EST


Andrew Morton <akpm@xxxxxxxx> writes:

> I'm not sure that the /proc/fd ownership patch is the correct solution to
> that bug yet; we'll see.

> dentry->d_inode->i_uid = task->euid;
> dentry->d_inode->i_gid = task->egid;
> + security_task_to_inode(task, dentry->d_inode);
> return 1;
> }
> d_drop(dentry);
> @@ -899,6 +900,7 @@
> put_files_struct(files);
> dentry->d_inode->i_uid = task->euid;
> dentry->d_inode->i_gid = task->egid;
> + security_task_to_inode(task, dentry->d_inode);
> return 1;
> }
> spin_unlock(&files->file_lock);

Umm.. Wasn't the following needed?

inode->i_uid = 0;
inode->i_gid = 0;
if (ino == PROC_PID_INO || task_dumpable(task)) {
--
OGAWA Hirofumi <hirofumi@xxxxxxxxxxxxxxxxxx>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/