diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2008-01-26 06:03:59 +0100 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2008-02-04 08:30:19 +0100 |
commit | 043b19cdc081f586a8f4e1c93ce6c03b63c26284 (patch) | |
tree | 11101abb0a5716c51ddae9bd7009718030efe510 | |
parent | dlm: fix overflows when copying from ->m_extra to lvb (diff) | |
download | linux-043b19cdc081f586a8f4e1c93ce6c03b63c26284.tar.xz linux-043b19cdc081f586a8f4e1c93ce6c03b63c26284.zip |
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 <viro@zeniv.linux.org.uk>
Signed-off-by: David Teigland <teigland@redhat.com>
-rw-r--r-- | 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 831050e5bfd5..85defeb64df4 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; |