mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Where does user_path_walk() live?
@ 2003-10-12 20:26 kevin conaway
  2003-10-12 20:38 ` viro
  0 siblings, 1 reply; 4+ messages in thread
From: kevin conaway @ 2003-10-12 20:26 UTC (permalink / raw)
  To: linux-kernel

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Where does user_path_walk() live?
  2003-10-12 20:26 Where does user_path_walk() live? kevin conaway
@ 2003-10-12 20:38 ` viro
  2003-10-12 20:59   ` Valdis.Kletnieks
  0 siblings, 1 reply; 4+ messages in thread
From: viro @ 2003-10-12 20:38 UTC (permalink / raw)
  To: kevin conaway; +Cc: linux-kernel

On Sun, Oct 12, 2003 at 01:26:09PM -0700, kevin conaway wrote:
> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Where does user_path_walk() live?
  2003-10-12 20:38 ` viro
@ 2003-10-12 20:59   ` Valdis.Kletnieks
  2003-10-12 21:41     ` viro
  0 siblings, 1 reply; 4+ messages in thread
From: Valdis.Kletnieks @ 2003-10-12 20:59 UTC (permalink / raw)
  To: viro; +Cc: kevin conaway, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 849 bytes --]

On Sun, 12 Oct 2003 21:38:19 BST, viro@parcelfarce.linux.theplanet.co.uk said:
> On Sun, Oct 12, 2003 at 01:26:09PM -0700, kevin conaway wrote:
> > 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

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....

[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Where does user_path_walk() live?
  2003-10-12 20:59   ` Valdis.Kletnieks
@ 2003-10-12 21:41     ` viro
  0 siblings, 0 replies; 4+ messages in thread
From: viro @ 2003-10-12 21:41 UTC (permalink / raw)
  To: Valdis.Kletnieks; +Cc: kevin conaway, linux-kernel

On Sun, Oct 12, 2003 at 04:59:58PM -0400, Valdis.Kletnieks@vt.edu wrote:
> On Sun, 12 Oct 2003 21:38:19 BST, viro@parcelfarce.linux.theplanet.co.uk said:
> > On Sun, Oct 12, 2003 at 01:26:09PM -0700, kevin conaway wrote:
> > > 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
> 
> 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...

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-10-12 21:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-12 20:26 Where does user_path_walk() live? kevin conaway
2003-10-12 20:38 ` viro
2003-10-12 20:59   ` Valdis.Kletnieks
2003-10-12 21:41     ` viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®