Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761150AbYBZDZq (ORCPT ); Mon, 25 Feb 2008 22:25:46 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760674AbYBZDZP (ORCPT ); Mon, 25 Feb 2008 22:25:15 -0500 Received: from out3.smtp.messagingengine.com ([66.111.4.27]:32805 "EHLO out3.smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755509AbYBZDZM (ORCPT ); Mon, 25 Feb 2008 22:25:12 -0500 X-Sasl-enc: NMAuFYuQT50/bhgdPyb9aJlx2i/Mh2LKqq4weZQwD9sV 1203996311 Date: Tue, 26 Feb 2008 12:22:34 +0900 (WST) From: Ian Kent To: Andrew Morton cc: Kernel Mailing List , autofs mailing list , linux-fsdevel Subject: [PATCH 1/4] autofs4 - check for invalid dentry in getpath In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 930 Lines: 26 Hi Andrew, Patch to catch invalid dentry when calculating it's path. Signed-off-by: Ian Kent 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; } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/