oe-lkp.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Alexey Gladkov <legion@kernel.org>
To: lkp@lists.01.org
Subject: [PATCH] sysctl: Fix mq permission check
Date: Wed, 05 Oct 2022 19:07:30 +0200	[thread overview]
Message-ID: <20221005170730.835761-1-legion@kernel.org> (raw)
In-Reply-To: <202210052100.86dbb00a-yujie.liu@intel.com>

[-- Attachment #1: Type: text/plain, Size: 856 bytes --]

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(a)intel.com
Fixes: 7608b6a72ed0 ("sysctl: Allow to change limits for posix messages queues")
Signed-off-by: Alexey Gladkov <legion@kernel.org>
---
 ipc/mq_sysctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ipc/mq_sysctl.c b/ipc/mq_sysctl.c
index ff1054fbbacc..ce03930aced5 100644
--- a/ipc/mq_sysctl.c
+++ b/ipc/mq_sysctl.c
@@ -102,7 +102,7 @@ static int mq_permissions(struct ctl_table_header *head, struct ctl_table *table
 	if (uid_eq(current_euid(), ns_root_uid))
 		mode >>= 6;
 
-	if (in_egroup_p(ns_root_gid))
+	else if (in_egroup_p(ns_root_gid))
 		mode >>= 3;
 
 	mode &= 7;
-- 
2.33.4

      reply	other threads:[~2022-10-05 17:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-05 13:58 [sysctl] 7608b6a72e: kernel-selftests.mqueue.mq_open_tests.fail kernel test robot
2022-10-05 17:07 ` Alexey Gladkov [this message]

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=20221005170730.835761-1-legion@kernel.org \
    --to=legion@kernel.org \
    --cc=lkp@lists.01.org \
    /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).