Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2222214rwb; Wed, 5 Oct 2022 10:46:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5yrqoiRvyk3QFAc5AO8FbydL+FE871hO/r9/paWmf6iIi6+5gAYqwJMbbp6nJ9WW0Zdmag X-Received: by 2002:a62:f206:0:b0:55f:4bce:6b85 with SMTP id m6-20020a62f206000000b0055f4bce6b85mr587185pfh.24.1664991986969; Wed, 05 Oct 2022 10:46:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664991986; cv=none; d=google.com; s=arc-20160816; b=brP29ORdGspkZITwT50N/AyJ8FmAjE2BTt9vSdRijzXvL9bqc/ZxESv5L5RoVdoefq q03u9u/BMVzlu8EY9y9ukaPtXacwoe5RFGcB+aAg+562pZz7zlbHAW8t8P9l8CS8CauY UmBs50q0xfnmheEIaMhuOmpaZaqh0QoCjdgBAygZtBkqdohNGKwu4YeecZFj0wz8TR6A thXZkOdI8n9LIa+hBKhrXb+YjJuCtmBSg8x+5Wp1Zw6gQf/HYp7miQmyF9wAbei96HQW MVEmxt/hM9ODc/rGIZkNdJ4bEo7IJ+fs/0irdxeNZUcWvCVrT/K5s/1qaW+/mIE3uXay 3PGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=BznD6hxElubFGGKTjjjQqjVojX9weGYKbCfGSLeGAGo=; b=OEybJBrEx9xRfHIso21z43Pl6ZD5GQize+924MFznKcaarZABcW1YY5v3OpH166KIt OHvbcJzsE8nixKrdnnc5k3neXyVCSvsmcL02PqevEtJ5lJurZVvc1QkG24gNDhlAf/Rg wP/OLNogPWlHcIr/z/O6cfJ6aPGMun0DAv3KtJ9y4aXThhJQK1OZPFi3rnUw7nLrmAS3 JIKbBhK+JDp8d0mtZKHecNqKIZ3OmPjYqM5q8BhkE6FvRhIVJvId486ZPu2irUFGOzMW qpL5CkcZ7B9Qmlw64XGlLNcvpB2nvRKq9H14gy3uSxrHKMiH7+/2Ba8KW1dWIdVo7grr LiIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d9-20020a056a00198900b00550ec562c79si16069199pfl.369.2022.10.05.10.46.14; Wed, 05 Oct 2022 10:46:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229950AbiJERID (ORCPT + 99 others); Wed, 5 Oct 2022 13:08:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbiJERIB (ORCPT ); Wed, 5 Oct 2022 13:08:01 -0400 Received: from us-smtp-delivery-44.mimecast.com (us-smtp-delivery-44.mimecast.com [207.211.30.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C515269F57 for ; Wed, 5 Oct 2022 10:08:00 -0700 (PDT) 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 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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