From: Al Viro Date: Sat, 26 Jan 2008 05:03:59 +0000 (-0500) Subject: dlm: fix dlm_dir_lookup() handling of too long names X-Git-Tag: v2.6.25-rc1~42^2~4 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=043b19cdc081f586a8f4e1c93ce6c03b63c26284;p=~emulex%2Finfiniband.git dlm: fix dlm_dir_lookup() handling of too long names ... those can happen and BUG() from DLM_ASSERT() in allocate_direntry() is not a good way to handle them. Signed-off-by: Al Viro Signed-off-by: David Teigland --- diff --git a/fs/dlm/dir.c b/fs/dlm/dir.c index 831050e5bfd..85defeb64df 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;