LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 12/16] dlm: fix dlm_dir_lookup() handling of too long names
@ 2008-02-07  6:09 David Teigland
  0 siblings, 0 replies; only message in thread
From: David Teigland @ 2008-02-07  6:09 UTC (permalink / raw)
  To: linux-kernel; +Cc: Al Viro

From: Al Viro <viro@zeniv.linux.org.uk>

... those can happen and BUG() from DLM_ASSERT() in allocate_direntry() is
not a good way to handle them.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David Teigland <teigland@redhat.com>
---
 fs/dlm/dir.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/fs/dlm/dir.c b/fs/dlm/dir.c
index 831050e..85defeb 100644
--- a/fs/dlm/dir.c
+++ b/fs/dlm/dir.c
@@ -319,6 +319,9 @@ static int get_entry(struct dlm_ls *ls, int nodeid, char *name,
 
 	write_unlock(&ls->ls_dirtbl[bucket].lock);
 
+	if (namelen > DLM_RESNAME_MAXLEN)
+		return -EINVAL;
+
 	de = kzalloc(sizeof(struct dlm_direntry) + namelen, GFP_KERNEL);
 	if (!de)
 		return -ENOMEM;
-- 
1.5.3.3


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-02-07  6:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-07  6:09 [PATCH 12/16] dlm: fix dlm_dir_lookup() handling of too long names David Teigland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).