Skip to contentSkip to conversation

MAX_NESTED_LINKS

DISCUSSION Steve French 2 participants 2 messages Aug 31, 2004

lore
Share & tools
lore
#0 lore raw

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);

#1 lore raw
Quoted 2 lines · Steve French

MAX_NESTED_LINKS seems to have been set to 5, but the comment in fs/namei.c indicates 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.