Where does user_path_walk() live?
I am a student doing an independent study on filesystem security and I was trying to pin down exactly where a users permissions are checked when trying to access a particular file. Looking through the various system calls in /usr/src/linux/fs/open.c tells me that each call that requires a permission check calls user_path_walk() to essentially "walk" through the parts of the path to make sure the sure has access to each part. I attempted to find the code for user_path_walk() but all I could find was a #define statement that showed user_path_walk was really a macro for __user_walk(). All I could find were symbol references for __user_walk() in the kernel tree. Does anyone know where this code lives?
Thanks
Kevin Conaway
__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
Quoted 2 lines · kevin conaway
I am a student doing an independent study on
filesystem security and I was trying to pin down
man find
man xargs
man grep
RTFUnixFAQ
Quoted 9 lines · On Sun, 12 Oct 2003 21:38:19 BST, [email protected] said:
Quoted 2 lines · kevin conaway
I am a student doing an independent study on
filesystem security and I was trying to pin downman find
man xargs
man grepRTFUnixFAQ
Actually, the answer Kevin wanted was:
cd /usr/src/linux
grep -r __user_walk .
which will tell you it's in fs/namei.c - near line 967 for 2.6.9-test7 tree.
Unfortunately, it's basically a wrapper for path_lookup (also in fs/namei.c maybe 110 lines up from there).. which will drop you into link_path_walk() a ways above that. link_path_walk() is where the actual fun happens - note that most of link_path_walk()'s actual work is done by calls to do_lookup() and follow_mount().
I would suggest Kevin read and understand *ALL* of fs/namei.c....
Quoted 9 lines · On Sun, Oct 12, 2003 at 04:59:58PM -0400, [email protected] wrote:
Quoted 8 lines · On Sun, 12 Oct 2003 21:38:19 BST, [email protected] said:
Quoted 2 lines · kevin conaway
I am a student doing an independent study on
filesystem security and I was trying to pin downman find
man xargs
man grep
Quoted 6 lines
Quoted 1 line
RTFUnixFAQ
Actually, the answer Kevin wanted was:
cd
/usr/src/linux
grep -r__user_walk.
Ehh... First of all, you'll end up doing a metric buttload of getdents() for no good reason every time you want to search for something. And on the kernel source that's pretty noticable.
Moreover, you generally do *not* want to deal with every file in the tree - find . -name *.[chS] does it nicely, grep -r can't do that at all.
grep -r is a pointless GNUism. It's not safer than find + xargs grep, it's weaker than use of find and it's non-portable to boot...