MAX_NESTED_LINKS
MAX_NESTED_LINKS seems to have been set to 5, but the comment in fs/namei.c indicates a larger number. Is that intentional?
* This limits recursive symlink follows to 8, while
* limiting consecutive symlinks to 40.
@@ -405,19 +407,30 @@
static inline int do_follow_link(struct dentry *dentry, struct nameidata *nd)
{
int err = -ELOOP;
if (current->link_count >= MAX_NESTED_LINKS)
goto loop; if (current->total_link_count >= 40) goto loop;
BUG_ON(nd->depth >= MAX_NESTED_LINKS);
Quoted 2 lines · Steve French
MAX_NESTED_LINKSseems to have been set to 5, but the comment infs/namei.cindicates a larger number. Is that intentional?
yes for now; 8 overflowed stacks on several architectures. Al Viro has a patch series is finalizing getting that merged that makes it safe to use 8 again.