Re: patch: new sysctl to remove hardcoded ELOOP limit

Gregory S. Stark (gsstark@MIT.EDU)
10 Apr 1998 23:09:12 -0400


Pavel Machek <pavel@elf.ucw.cz> writes:

>>> ELOOP variable.The reason that there's a hard-coded limit in the first
>>> place is that symlink traversal uses recursion, and the kernel stack has a
>>> hard-coded limit. In addition, it's not that easy to figure out worst-case
>>> stack usage, since you don't know what various file systems may need to do
>>> to resolve symlinks.
>>>
>>> Hence a hard-coded safe limit is called for here.
>
> Note, that if you set it to *too* high number, you are in _much_ worse
> problem. (AKA random reboots.)

Has no one pointed out that there's no reason symlink traversal needs to be
recursive? It should be easy enough to switch to an iterative implementation
which would be able to handle an arbitrary number of links. (Though of course
some limit would still be needed to prevent infinite loops).

> 5 is considered safe limit. No reason to have it lower. If you know
> safe up limit, hardcode *that* limit.

I could imagine someone somewhere wanting to disable symlinks completely.
There's no reason to impose a specific limit if someone does the work to
make it a sysctl. But the code does need to be changed to actually handle
the new range of values.

greg

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