[PATCH 1/4] autofs4 - check for invalid dentry in getpath

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Ian Kent
Date: Monday, February 25, 2008 - 8:22 pm

Hi Andrew,

Patch to catch invalid dentry when calculating it's path.

Signed-off-by: Ian Kent <raven@themaw.net>

Ian

---
diff -up linux-2.6.25-rc2-mm1/fs/autofs4/waitq.c.getpath-check-valid-dentry linux-2.6.25-rc2-mm1/fs/autofs4/waitq.c
--- linux-2.6.25-rc2-mm1/fs/autofs4/waitq.c.getpath-check-valid-dentry	2008-02-20 12:55:39.000000000 +0900
+++ linux-2.6.25-rc2-mm1/fs/autofs4/waitq.c	2008-02-20 12:54:46.000000000 +0900
@@ -171,7 +171,7 @@ static int autofs4_getpath(struct autofs
 	for (tmp = dentry ; tmp != root ; tmp = tmp->d_parent)
 		len += tmp->d_name.len + 1;
 
-	if (--len > NAME_MAX) {
+	if (!len || --len > NAME_MAX) {
 		spin_unlock(&dcache_lock);
 		return 0;
 	}
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 1/4] autofs4 - check for invalid dentry in getpath, Ian Kent, (Mon Feb 25, 8:22 pm)
Re: [PATCH 3/4] autofs4 - track uid and gid of last mount ..., Pavel Emelyanov, (Thu Feb 28, 12:51 am)
Re: [autofs] [PATCH 3/4] autofs4 - track uid and gid of la ..., Fabio Olive Leite, (Thu Feb 28, 5:31 am)
Re: [PATCH 3/4] autofs4 - track uid and gid of last mount ..., Serge E. Hallyn, (Thu Feb 28, 12:51 pm)
Re: [PATCH 3/4] autofs4 - track uid and gid of last mount ..., Eric W. Biederman, (Thu Feb 28, 1:33 pm)
Re: [PATCH 3/4] autofs4 - track uid and gid of last mount ..., Serge E. Hallyn, (Fri Feb 29, 10:42 am)
Re: [PATCH 3/4] autofs4 - track uid and gid of last mount ..., Eric W. Biederman, (Sat Mar 1, 5:49 pm)
Re: [PATCH 3/4] autofs4 - track uid and gid of last mount ..., Eric W. Biederman, (Sat Mar 1, 6:13 pm)
Re: [PATCH 3/4] autofs4 - track uid and gid of last mount ..., Eric W. Biederman, (Tue Mar 4, 3:16 pm)