From: Petter Reinholdtsen <pere@hungry.com>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] Increase recursive symlink limit from 5 to 8
Date: Thu, 08 Jan 2004 00:12:03 +0100 [thread overview]
Message-ID: <E1AeMqJ-00022k-00@minerva.hungry.com> (raw)
The comment in do_follow_link() do not match the code. The comment
explain that the limit for recursive symlinks are 8, but the code
limit it to 5. This is the current comment:
/*
* This limits recursive symlink follows to 8, while
* limiting consecutive symlinks to 40.
*
* Without that kind of total limit, nasty chains of consecutive
* symlinks can cause almost arbitrarily long lookups.
*/
I discovered it when I ran into a problem with the following symlinks
producing the error message "Too many levels of symbolic links" when I
tried to run /usr/lib/sendmail in our current software configuration.
/usr/lib/sendmail -> /local/sbin/sendmail
/local/sbin/sendmail -> /store/store/diskless/.exim/ver-4.22/sbin/sendmail
/store/store/diskless/.exim/ver-4.22/sbin/sendmail -> /local/sbin/exim
/local/sbin/exim ->
/store/store/diskless/.exim/ver-4.22/sbin/exim@386linuxlibc62
As you can see, this have to visit exactly 5 files to reach the real
file "/store/store/diskless/.exim/ver-4.22/sbin/exim@386linuxlibc62".
I discovered this when testing Debian for the first time using this
software configuration. RedHat did not have any problems follwing the
links, which suggests to me that they already increased the limit.
The fix seem to be to bring the code in sync with the comment of the
function, and increase the limit from 5 to 8.
--- linux-2.4.24/fs/namei.c.orig Wed Jan 7 23:46:03 2004
+++ linux-2.4.24/fs/namei.c Wed Jan 7 23:46:34 2004
@@ -335,7 +335,7 @@
static inline int do_follow_link(struct dentry *dentry, struct nameidata *nd)
{
int err;
- if (current->link_count >= 5)
+ if (current->link_count >= 8)
goto loop;
if (current->total_link_count >= 40)
goto loop;
(I'm not on this mailing list, and do not really know how to proceed
to increase the chances of this patch being accepted into the official
source. Please CC me if you reply. :)
next reply other threads:[~2004-01-07 23:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-07 23:12 Petter Reinholdtsen [this message]
2004-01-11 1:03 ` [PATCH] Increase recursive symlink limit from 5 to 8 Petter Reinholdtsen
2004-01-11 7:01 ` Steve Youngs
2004-01-11 9:37 ` Peter Osterlund
2004-01-11 9:49 ` Arjan van de Ven
2004-01-16 0:45 ` GOTO Masanori
2004-01-16 0:56 ` Måns Rullgård
2004-01-16 1:25 ` viro
2004-01-16 15:46 ` Andries Brouwer
2004-01-16 3:08 ` Steve Youngs
2004-01-11 12:10 ` Felipe Alfaro Solana
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1AeMqJ-00022k-00@minerva.hungry.com \
--to=pere@hungry.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox