From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C067C433F5 for ; Wed, 5 Oct 2022 17:07:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 344A36B0072; Wed, 5 Oct 2022 13:07:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2F38B6B0073; Wed, 5 Oct 2022 13:07:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1947B6B0074; Wed, 5 Oct 2022 13:07:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 031D66B0072 for ; Wed, 5 Oct 2022 13:07:56 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id C667A40CDA for ; Wed, 5 Oct 2022 17:07:56 +0000 (UTC) X-FDA: 79987528152.14.01F51FE Received: from us-smtp-delivery-44.mimecast.com (us-smtp-delivery-44.mimecast.com [207.211.30.44]) by imf05.hostedemail.com (Postfix) with ESMTP id 532CF100015 for ; Wed, 5 Oct 2022 17:07:56 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-121-miWDTMJbMfezS5CRUDpT-w-1; Wed, 05 Oct 2022 13:07:54 -0400 X-MC-Unique: miWDTMJbMfezS5CRUDpT-w-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D329F811E81; Wed, 5 Oct 2022 17:07:53 +0000 (UTC) Received: from comp-core-i7-2640m-0182e6.redhat.com (unknown [10.40.208.45]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2F5D12024CC6; Wed, 5 Oct 2022 17:07:35 +0000 (UTC) From: Alexey Gladkov To: kernel test robot , "Eric W. Biederman" , Alexey Gladkov Cc: lkp@lists.01.org, lkp@intel.com, Linux Memory Management List , linux-kernel@vger.kernel.org Subject: [PATCH] sysctl: Fix mq permission check Date: Wed, 5 Oct 2022 19:07:30 +0200 Message-Id: <20221005170730.835761-1-legion@kernel.org> In-Reply-To: <202210052100.86dbb00a-yujie.liu@intel.com> References: <202210052100.86dbb00a-yujie.liu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1664989676; a=rsa-sha256; cv=none; b=hT9wfyL3PkvFznZkqITZtm2DlcfFMBuLlg+fiKYYc1j+10nOrH6ye2er5kMkhGXmE3kbDE FaP76veg4qQML79oLui6yeIm3M9gxQz9wkyvE6ZYry3Sx1+SeXg52cvm7ltb1aSkwf2JIJ tJGBQHedCXZzW8mmovqCAaIJXAUM8Y4= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=kernel.org (policy=none); spf=softfail (imf05.hostedemail.com: 207.211.30.44 is neither permitted nor denied by domain of legion@kernel.org) smtp.mailfrom=legion@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1664989676; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BznD6hxElubFGGKTjjjQqjVojX9weGYKbCfGSLeGAGo=; b=3RBJQd8sJ62BIGBRytpm3fui17nL3gDJT9OJGq3R+DAL9ITRd7SHPLxwutAqXWE4ZgNYYI pyjLLNe7WAGcJDqIWngwpIbfMG2qB4XIYAUODxmiv98xz62vLLEOwiD3tgwdaUxNR23chJ 2vrNOGIBBOZghS+MPf5ShdhCQjQ+H/M= X-Rspamd-Server: rspam08 X-Rspam-User: X-Rspamd-Queue-Id: 532CF100015 Authentication-Results: imf05.hostedemail.com; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=kernel.org (policy=none); spf=softfail (imf05.hostedemail.com: 207.211.30.44 is neither permitted nor denied by domain of legion@kernel.org) smtp.mailfrom=legion@kernel.org X-Stat-Signature: tf3kp8p9mc73jjbrc1e65gomiknictk9 X-HE-Tag: 1664989676-664526 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The kernel test robot found a typo that causes mq_permissions() to return a useless value. Reported-by: kernel test robot Link: https://lore.kernel.org/r/202210052100.86dbb00a-yujie.liu@intel.com Fixes: 7608b6a72ed0 ("sysctl: Allow to change limits for posix messages queues") Signed-off-by: Alexey Gladkov --- 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