Whamcloud - gitweb
LU-13257 llite: Disallow users to set/clear group lock flag 82/53782/3
authorMatt Ezell <ezellma@ornl.gov>
Tue, 23 Jan 2024 15:40:52 +0000 (18:40 +0300)
committerOleg Drokin <green@whamcloud.com>
Fri, 23 Feb 2024 07:14:34 +0000 (07:14 +0000)
Group locks are created/freed via dedicated ioctls. Disallow manually
setting or clearing the flag.

HPE-bug-id: LUS-12078
Signed-off-by: Vitaly Fertman <vitaly.fertman@hpe.com>
Signed-off-by: Matt Ezell <ezellma@ornl.gov>
Change-Id: Id5022cc02a7bdce2f0150592470e8336b4537a61
Reviewed-on: https://es-gerrit.hpc.amslabs.hpecorp.net/162708
Reviewed-by: Andriy Skulysh <andriy.skulysh@hpe.com>
Reviewed-by: Vitaly Fertman <vitaly.fertman@hpe.com>
Tested-by: Alexander Lezhoev <alexander.lezhoev@hpe.com>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53782
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/llite/file.c

index 945f49c..ffc16d2 100644 (file)
@@ -4366,6 +4366,10 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                if (get_user(flags, (int __user *)arg))
                        RETURN(-EFAULT);
 
+               /* LL_FILE_GROUP_LOCKED is managed via its own ioctls */
+               if (flags & LL_FILE_GROUP_LOCKED)
+                       RETURN(-EINVAL);
+
                if (cmd == LL_IOC_SETFLAGS) {
                        if ((flags & LL_FILE_IGNORE_LOCK) &&
                            !(file->f_flags & O_DIRECT)) {