Re: [PATCH+discussion] symlink recursion

From: Daniel Phillips (phillips@bonn-fries.net)
Date: Wed Jun 19 2002 - 09:44:48 EST


On Wednesday 19 June 2002 01:57, Linus Torvalds wrote:
> I see no advantages to handling it by hand, since this isn't even a very
> deep recursion, and since even if you do the recursive part by hand by a
> linked list you still need to limit the depth _anyway_ to avoid DoS
> attacks.

It's the recursive trip through the filesystem that causes the problem.
Suddenly the stack space consumption becomes (N * greediest_filesystem) and
that has to be factored into all worst case calculations. It's a huge hole
to blow out of this severely restricted resource, so reducing N to 1 is a big
deal.

Also, as a practical matter, it's much easier to lay down a rule for
filesystem developers that reads: "thou shalt in no case use more than N
bytes of stack on your longest path" than "in no case use more than N bytes
of stack except on any symlink resolution path, in which case see the limit
on recursive symlinks to know how to analyze that path".

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



This archive was generated by hypermail 2b29 : Sun Jun 23 2002 - 22:00:19 EST