]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
dlm: check for undefined release_option values
authorAlexander Aring <aahringo@redhat.com>
Thu, 14 Aug 2025 15:22:14 +0000 (11:22 -0400)
committerDavid Teigland <teigland@redhat.com>
Thu, 14 Aug 2025 20:16:05 +0000 (15:16 -0500)
Checking on all undefined release_option values to return -EINVAL in
case a user is providing them to dlm_release_lockspace().

Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/lockspace.c
include/linux/dlm.h

index 8eadbf0fdf179d5f5c31962dc46ef137c88be059..ddaa765587068f0f9f250713ed4b686b7c91911a 100644 (file)
@@ -797,6 +797,9 @@ int dlm_release_lockspace(void *lockspace, unsigned int release_option)
        struct dlm_ls *ls;
        int error;
 
+       if (release_option > __DLM_RELEASE_MAX)
+               return -EINVAL;
+
        ls = dlm_find_lockspace_local(lockspace);
        if (!ls)
                return -EINVAL;
index 34015a008b801ca8a08754f0832bab4d890b1c99..7e7b45b0d097090c78576e5f0e67a95b49e99b7a 100644 (file)
@@ -113,6 +113,7 @@ int dlm_new_lockspace(const char *name, const char *cluster,
 #define DLM_RELEASE_NORMAL             2
 #define DLM_RELEASE_NO_EVENT           3
 #define DLM_RELEASE_RECOVER            4
+#define __DLM_RELEASE_MAX              DLM_RELEASE_RECOVER
 
 /*
  * dlm_release_lockspace