Commit 043b19cdc081f586a8f4e1c93ce6c03b63c26284

Authored by Al Viro
Committed by David Teigland
1 parent a9cc915928

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>

Showing 1 changed file with 3 additions and 0 deletions Side-by-side Diff

... ... @@ -319,6 +319,9 @@
319 319  
320 320 write_unlock(&ls->ls_dirtbl[bucket].lock);
321 321  
  322 + if (namelen > DLM_RESNAME_MAXLEN)
  323 + return -EINVAL;
  324 +
322 325 de = kzalloc(sizeof(struct dlm_direntry) + namelen, GFP_KERNEL);
323 326 if (!de)
324 327 return -ENOMEM;