mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 06:04:44 +01:00
dlm: validate length in dlm_search_rsb_tree
The len parameter in dlm_dump_rsb_name() is not validated and comes from network messages. When it exceeds DLM_RESNAME_MAXLEN, it can cause out-of-bounds write in dlm_search_rsb_tree(). Add length validation to prevent potential buffer overflow. Signed-off-by: Ezrak1e <ezrakiez@gmail.com> Signed-off-by: Alexander Aring <aahringo@redhat.com> Signed-off-by: David Teigland <teigland@redhat.com>
This commit is contained in:
parent
1416bd508c
commit
080e5563f8
1 changed files with 2 additions and 1 deletions
|
|
@ -626,7 +626,8 @@ int dlm_search_rsb_tree(struct rhashtable *rhash, const void *name, int len,
|
|||
struct dlm_rsb **r_ret)
|
||||
{
|
||||
char key[DLM_RESNAME_MAXLEN] = {};
|
||||
|
||||
if (len > DLM_RESNAME_MAXLEN)
|
||||
return -EINVAL;
|
||||
memcpy(key, name, len);
|
||||
*r_ret = rhashtable_lookup_fast(rhash, &key, dlm_rhash_rsb_params);
|
||||
if (*r_ret)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue