From: Alexander Aring <aahringo@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH dlm-next 1/2] fs: dlm: check for invalid namelen
Date: Fri, 11 Dec 2020 10:47:17 -0500 [thread overview]
Message-ID: <20201211154718.99346-2-aahringo@redhat.com> (raw)
In-Reply-To: <20201211154718.99346-1-aahringo@redhat.com>
This patch adds an additional check inside the dlm locking from user space
functionality that the namelen isn't above the maximum allowed dlm
resource name length.
Signed-off-by: Alexander Aring <aahringo@redhat.com>
---
fs/dlm/user.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/dlm/user.c b/fs/dlm/user.c
index e5cefa90b1ce..9f2f743eeb31 100644
--- a/fs/dlm/user.c
+++ b/fs/dlm/user.c
@@ -241,6 +241,9 @@ static int device_user_lock(struct dlm_user_proc *proc,
uint32_t lkid;
int error = -ENOMEM;
+ if (params->namelen > DLM_RESNAME_MAXLEN)
+ return -EINVAL;
+
ls = dlm_find_lockspace_local(proc->lockspace);
if (!ls)
return -ENOENT;
--
2.26.2
next prev parent reply other threads:[~2020-12-11 15:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-11 15:47 [Cluster-devel] [PATCH dlm-next 0/2] fs: dlm: dlm lock from user space fixes Alexander Aring
2020-12-11 15:47 ` Alexander Aring [this message]
2020-12-11 15:47 ` [Cluster-devel] [PATCH dlm-next 2/2] fs: dlm: transparently align name buffer Alexander Aring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201211154718.99346-2-aahringo@redhat.com \
--to=aahringo@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).