From: Al Viro <viro@ftp.linux.org.uk>
To: Sripathi Kodi <sripathik@in.ibm.com>
Cc: Al Viro <viro@ZenIV.linux.org.uk>,
Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org, patrics@interia.pl,
Ingo Molnar <mingo@elte.hu>, Roland McGrath <roland@redhat.com>
Subject: Re: [PATCH 2.6.13.1] Patch for invisible threads
Date: Fri, 16 Sep 2005 08:46:06 +0100 [thread overview]
Message-ID: <20050916074606.GE19626@ftp.linux.org.uk> (raw)
In-Reply-To: <432A17E0.3060302@in.ibm.com>
On Thu, Sep 15, 2005 at 07:54:56PM -0500, Sripathi Kodi wrote:
> proc_root_link and proc_task_root_link still have some duplicated code. I
> could have split these functions further to avoid duplication completely,
> but that would move incrementing and decrementing fs->lock to two different
> functions, which I think will be confusing.
>
> The other way of implementing this that I could think of was to have a flag
> to indicate that the call is from ->permission path and pass it all along.
> This will avoid having to change many existing functions, but it will
> defeat the purpose of limiting this kludge code to ->permission path.
>
> Please let me know how it is looking now.
Ugh... Considering that all of that is _only_ for /proc/<pid>/task and
that proc_permission() is a couple of function calls, why bother with
proc_task_check_root() instead of just adding proc_task_permission() with
{
struct dentry *root;
struct vfsmount *vfsmnt;
if (generic_permission(inode, mask, NULL) != 0)
return -EACCES;
/* or just open-code it here, for that matter */
if (proc_task_root_link(inode, &root, &vfsmnt))
return -ENOENT;
return proc_check_chroot(root, vfsmnt);
}
for a body and leaving proc_permission() without any changes at all?
> Further, about actual permission checks that we are doing, can we say: "A
> process should be able to see /proc/<pid>/task/* of another process only if
> they both belong to same uid or reader is root"? But any such change will
> change the behavior of commands like 'ps', right?
Right. The real question is whether the current behaviour makes any sense.
I've no objections to your patch + modification above, but I really wonder
if we should keep current rules in that area.
next prev parent reply other threads:[~2005-09-16 7:46 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-12 17:46 [PATCH 2.6.13.1] Patch for invisible threads Sripathi Kodi
2005-09-12 20:49 ` Andrew Morton
2005-09-13 13:10 ` Sripathi Kodi
2005-09-13 14:53 ` Linus Torvalds
2005-09-13 16:51 ` Al Viro
2005-09-13 17:01 ` Linus Torvalds
2005-09-13 17:12 ` Al Viro
2005-09-13 21:30 ` Sripathi Kodi
2005-09-13 21:56 ` Roland McGrath
2005-09-13 21:57 ` Al Viro
2005-09-13 23:10 ` Linus Torvalds
2005-09-14 1:47 ` Sripathi Kodi
2005-09-14 1:52 ` Al Viro
2005-09-14 14:37 ` Bill Davidsen
2005-09-15 0:30 ` Sripathi Kodi
2005-09-14 1:50 ` Al Viro
2005-09-15 0:31 ` Sripathi Kodi
2005-09-15 0:55 ` Roland McGrath
2005-09-15 1:38 ` Sripathi Kodi
2005-09-15 2:12 ` Al Viro
2005-09-15 7:29 ` Roland McGrath
2005-09-15 1:18 ` Al Viro
2005-09-16 0:54 ` Sripathi Kodi
2005-09-16 7:46 ` Al Viro [this message]
2005-09-16 15:06 ` Sripathi Kodi
2005-09-16 18:05 ` Daniel Jacobowitz
2005-09-16 18:14 ` Al Viro
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050916074606.GE19626@ftp.linux.org.uk \
--to=viro@ftp.linux.org.uk \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=patrics@interia.pl \
--cc=roland@redhat.com \
--cc=sripathik@in.ibm.com \
--cc=torvalds@osdl.org \
--cc=viro@ZenIV.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox