From: Shaya Potter <spotter@cs.columbia.edu>
To: linux-fsdevel@vger.kernel.org
Subject: changing permission()/vfs_permission... to work on dentry
Date: 28 May 2003 16:43:08 -0400 [thread overview]
Message-ID: <1054154587.9356.15.camel@zaphod> (raw)
I've gone through the entire fs/* vfs layer picking out every use of
permission to see if it can easily use the dentry instead, and it can
(list below showing that the dentry is readily available in every vfs
case)
The idea for converting it over would be to at first add 2 temporary
functions, entry_permission() and dentry_vfs_permission(), so that one
can proceed incrementally, and then to do a total change over by getting
rid of the old permission() and vfs_permission() and renaming the
temporary functions to the regular.
I'm making an assumption (perhaps dangerous) that the fs permission()
functions directly mirrors vfs_permission() (based only on experience w/
nfs filesystem) and therefore since fs permission() function is only
called from permission() (as vfs_permission() can also be) and therefore
would all be easy to switch over.
anyways, just want to make sure that I'm not missing anything.
thanks,
shaya
-------------------------
exec.c
------
sys_use_lib()
error = permission(nd.dentry->d_inode, MAY_READ | MAY_EXEC);
open_exec()
inode = nd.dentry->d_inode;
int err = permission(inode, MAY_EXEC);
flush_old_exec()
permission(bprm->file->f_dentry->d_inode,MAY_READ)
prepare_binprm()
doesn't work off of permission directly - why?
namei.c
-------
vfs_permission()
change option to take a dentry and get inode from that,
instead of taking inode directly.
permission()
same as vfs_permission()
path_walk()
inode = nd->dentry->d_inode;
err = permission(inode, MAY_EXEC);
lookup_hash(struct dentry * base)
inode = base->d_inode;
err = permission(inode, MAY_EXEC);
static inline int may_delete(struct inode *dir,struct dentry *victim,
int isdir)
error = permission(dir,MAY_WRITE | MAY_EXEC);
since
if (!victim->d_inode || victim->d_parent->d_inode != dir)
return -ENOENT;
shouldn't be an issue.
static inline int may_create(struct inode *dir, struct dentry *child)
return permission(dir,MAY_WRITE | MAY_EXEC);
seems to be the same as above
open_namei()
inode = dentry->d_inode;
error = permission(inode,acc_mode);
vfs_rename_dir()
error = permission(old_dentry->d_inode, MAY_WRITE);
namespace.c
-----------
mount_is_safe()
if (permission(nd->dentry->d_inode, MAY_WRITE))
open.c
------
do_sys_truncate()
inode = nd.dentry->d_inode;
error = permission(inode,MAY_WRITE);
sys_utime()
inode = nd.dentry->d_inode;
error = permission(inode,MAY_WRITE)
sys_utimes()
inode = nd.dentry->d_inode;
error = permission(inode,MAY_WRITE)
sys_access()
res = permission(nd.dentry->d_inode, mode);
sys_chdir()
error = permission(nd.dentry->d_inode,MAY_EXEC);
sys_fchdir()
inode = dentry->d_inode;
error = permission(inode, MAY_EXEC);
sys_chroot()
error = permission(nd.dentry->d_inode,MAY_EXEC);
next reply other threads:[~2003-05-28 20:30 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-28 20:43 Shaya Potter [this message]
2003-05-28 21:48 ` changing permission()/vfs_permission... to work on dentry viro
2003-05-28 22:34 ` Shaya Potter
2003-05-28 22:53 ` viro
2003-05-29 0:33 ` Shaya Potter
2003-05-29 12:25 ` Jan Hudec
2003-05-29 12:41 ` viro
2003-05-29 12:40 ` Lucas Correia Villa Real
-- strict thread matches above, loose matches on Subject: below --
2003-05-29 0:55 viro
2003-05-29 4:20 ` Shaya Potter
2003-05-29 4:38 ` Chris Wright
2003-05-29 8:27 ` 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=1054154587.9356.15.camel@zaphod \
--to=spotter@cs.columbia.edu \
--cc=linux-fsdevel@vger.kernel.org \
/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