Skip to content

Commit b895e66

Browse files
legionusebiederm
authored andcommitted
sysctl: Fix mq permission check
The kernel test robot found a typo that causes mq_permissions() to return a useless value. Reported-by: kernel test robot <yujie.liu@intel.com> Link: https://lore.kernel.org/r/202210052100.86dbb00a-yujie.liu@intel.com Fixes: 7608b6a ("sysctl: Allow to change limits for posix messages queues") Signed-off-by: Alexey Gladkov <legion@kernel.org> Link: https://lkml.kernel.org/r/20221005170730.835761-1-legion@kernel.org Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
1 parent a799be9 commit b895e66

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ipc/mq_sysctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ static int mq_permissions(struct ctl_table_header *head, struct ctl_table *table
102102
if (uid_eq(current_euid(), ns_root_uid))
103103
mode >>= 6;
104104

105-
if (in_egroup_p(ns_root_gid))
105+
else if (in_egroup_p(ns_root_gid))
106106
mode >>= 3;
107107

108108
mode &= 7;

0 commit comments

Comments
 (0)