Skip to content
Snippets Groups Projects
Commit 2be8b5ce authored by Yang Sheng's avatar Yang Sheng
Browse files

Branch HEAD

b=17379
i=Brian(LLNL), johann

Set recursive symlink depth to 5 when kernel has 4K stack.
parent 69782ac3
No related merge requests found
......@@ -165,10 +165,22 @@ static LL_FOLLOW_LINK_RETURN_TYPE ll_follow_link(struct dentry *dentry,
#endif
CDEBUG(D_VFSTRACE, "VFS Op\n");
#if THREAD_SIZE < 8192
/*
* We set the limits recursive symlink to 5
* instead of default 8 when kernel has 4k stack
* to prevent stack overflow.
*/
if (current->link_count >= 5) {
rc = -ELOOP;
GOTO(out_release, rc);
}
#endif
down(&lli->lli_size_sem);
rc = ll_readlink_internal(inode, &request, &symname);
up(&lli->lli_size_sem);
if (rc) {
out_release:
path_release(nd); /* Kernel assumes that ->follow_link()
releases nameidata on error */
GOTO(out, rc);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment