lkml.org 
[lkml]   [1998]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: PATCH: smart symlink loop detection.
On Tue, 14 Apr 1998, Linus Torvalds wrote:

> On Tue, 14 Apr 1998, C. Scott Ananian wrote:
> >
> > What seems to be required is the following: those <fs>_follow_link
> > implementations that call lookup_dentry could be rewritten to instead
> > return the *arguments it would have passed to lookup_dentry*. We can then
> > move the actual iteration into lookup_dentry, removing all the recursion
> > *and* not requiring a stack. Extreme cleverness is required to avoid
> > limiting the path string length.
>
> We still need a specialized per-thread stack for the arguments, because we
> will get "recursive" follow-link invocations: when we get the return value
> from follow_link(), we not only have to act on that return value, we also
> have to act on the continuation of the old path we were traversing while
> doing the follow_link in the first place.

Right. I was thinking of doing some string magic to keep that stack in
the lookup string itself. My earlier comment about extreme cleverness
with the path string would apply. I think your explicit stack is actually
a much cleaner approach. I don't like doing string manipulation in C.

Are there path-length limits elsewhere in the kernel?

Also, my understanding is that the kernel can be preempted when it blocks
for a disk read, correct? So we still need a hard limit *somewhere* to
prevent a denial-of-service attack: the attacker creates a long loop of
symlinks, and then breaks the loop in the middle, isolating the two
tarjan-algorithm pointers and preventing the lookup from every
terminating.

I think the interesting question of the moment is whether the hybrid
approach solves enough problems (one, perhaps: the bind distribution) to
merit 2.2.x kernel inclusion. The eventual removal of all recursion is
undoubtedly a 2.3.X issue. I subscribe to kernel-digest, so I haven't
seen any comments from linux-kernel regulars yet one way or the other.
--Scott
@ @
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-oOO-(_)-OOo-=-=-=-=-=
C. Scott Ananian: cananian@lcs.mit.edu / Declare the Truth boldly and
Laboratory for Computer Science/Crypto / without hindrance.
Massachusetts Institute of Technology /META-PARRESIAS AKOLUTOS:Acts 28:31
-.-. .-.. .. ..-. ..-. --- .-. -.. ... -.-. --- - - .- -. .- -. .. .- -.
PGP key available via finger and from http://www.pdos.lcs.mit.edu/~cananian


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

\
 
 \ /
  Last update: 2005-03-22 13:42    [W:0.081 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site