Re: Should we have MAXSYMLINKS?

Alexander Viro (viro@math.psu.edu)
Wed, 13 Jan 1999 02:44:09 -0500 (EST)


On Wed, 13 Jan 1999, Roland McGrath wrote:

> There has always been an explicit check in BSD for following more than
> MAXSYMLINKS links. It is not expressing an implementation limit. The
> limit is there to catch infinite recursions (ln -s foo foo).
> This is what the ELOOP error exists to report.

Yes, indeed. I wrote that:
a) We have similar (see below) limit (5).
b) It is enforced in a single place.
c) It's low due to our implementation of namei() (recursive vs.
iterative).

My fault, I didn't check the actual code before posting. Yes, 4.4 counts
total amount of symlinks (kern/vfs_lookup.c::namei()), but IMHO it is not
clear that we should do the same. Counting nested symlinks is enough for
loop detection. Anyway, if we want to enforce such limit we can do it in
do_follow_link() and lookup_dentry().

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/