Message ID | 20211205145105.57824-8-leo.yan@linaro.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 210E2C433F5 for <linux-arm-kernel@archiver.kernel.org>; Sun, 5 Dec 2021 14:54:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=olmxkdG9PIgeZaMmDBa473F5BsLA7LuklZU7gYjgXSw=; b=wAkHcYQsFGIbkc ysIavji3hbNqOoNk/b28AAEEPrDsLnvyFUWAvVwMcT3QYtJadoDzzoLMCxFsPOKrSUSvEzoZNDwzQ N0uG1RNNPN+wBuY9jLl4mbXtmAXEhnWhdYEs8mDdq8UfGpfLJMMYZw3OrXvViWHxYoH6r15hTyKnX sjDLJqgJ8SJQ7GyVmqVLi3Hm0AjoF2prKYlTi62/ckNVGst6xCmg+Lh2IoFHO+fqFI7zFTNM9zqJd 3gxUKi3hVDqUQN2L+u2wljNUxv5Z8XBGHvCDZgFBGty0u+vtPZ7IIn8jMcH2kK2xgzka0RQ9G2O7N 9WBp3HlzOiZSuH2/QnfA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mtssf-001YYo-PU; Sun, 05 Dec 2021 14:52:46 +0000 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mtsrh-001YDb-Pg for linux-arm-kernel@lists.infradead.org; Sun, 05 Dec 2021 14:51:47 +0000 Received: by mail-pg1-x52f.google.com with SMTP id l190so7984078pge.7 for <linux-arm-kernel@lists.infradead.org>; Sun, 05 Dec 2021 06:51:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WoYH3kUyU3rR597Qe29Tyg1cbdekiS3zv4yqA77Ra+o=; b=PQrQcoOw1V9KP76uLbFLDEDyrU9vqBzJPlKj+pTPusgS4daHAq7p66wzfdvZqqIJc2 QRKtdzA1IbWpSH8mHpn027kXF9Mild4jnXfXrzwYxqZxzF9JDoK6kTv1YaFv05Il+rEv lIvw4Xq6j53moojd4Yjl4KoUFlH9LWXrmjmmWREieVyxw8BExrw3buKuSVltSk3mNAaz mh2fAPVWvCLZscc+IivAkObQD8K+H0FitLX6DJ4jpbHnoQAEwMEadj7f8xY8967azkF6 Q5w6kToRbIlON6L0NmISOYfuZ8vwO6RrksQaoigaYoCM56mEQPl8QUiaddf/27eSZl0n V4MQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WoYH3kUyU3rR597Qe29Tyg1cbdekiS3zv4yqA77Ra+o=; b=wq+HRZ4n0nLwW9MwiuQkPqe4c39LBytRta+ZBRRA5qE6l35HOpbzC2UqVy9cThSCxW YeqzbyYwNWTX0KAqTAZ1wc7gIZW8kow0le8IAiMuL67AUfKz3fmjuSqWYs5MMlWpiy9j Vm2yWivwlZmdOgihzEnzCUQgNmEC3ZXtyLMkSgCCyd+3TUwqBr2HlXWLH0SVnRAC7tZu YbSnjB18C6dGQO2tQ1UgXzGItHndOq+NpXU7/EI66OcDZuUrOhU+7NQcE40MMtwgFaga CApOQboWu51TzcGiBOMrFOwih80IGOBh9M+YXXvcF41SBBYNw5VOiGEowRfvGwHMAaDW wUwg== X-Gm-Message-State: AOAM531og+n/IXVRhqEE7BNDsun98/sqeviwainAq1GbeLA/9EwGJ7FT w81gR2stW3uTDpxUke8Ph4O+5Q== X-Google-Smtp-Source: ABdhPJycmQqaqKyYV6rADGSOztK52rZFL5guaz/TJWi/jAvOjSlm3KATDKooWY63M7hIdTmll6FeGw== X-Received: by 2002:aa7:8d0a:0:b0:4a2:82d7:1695 with SMTP id j10-20020aa78d0a000000b004a282d71695mr31790299pfe.86.1638715904962; Sun, 05 Dec 2021 06:51:44 -0800 (PST) Received: from localhost ([2602:feda:ddb:737a:816:168e:3e5a:d93]) by smtp.gmail.com with ESMTPSA id c3sm9960145pfv.67.2021.12.05.06.51.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Dec 2021 06:51:44 -0800 (PST) From: Leo Yan <leo.yan@linaro.org> To: "David S. Miller" <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>, Mathieu Poirier <mathieu.poirier@linaro.org>, Suzuki K Poulose <suzuki.poulose@arm.com>, Mike Leach <mike.leach@linaro.org>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, Jan Harkes <jaharkes@cs.cmu.edu>, coda@cs.cmu.edu, Paul Moore <paul@paul-moore.com>, Eric Paris <eparis@redhat.com>, Balbir Singh <bsingharora@gmail.com>, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, codalist@coda.cs.cmu.edu, linux-audit@redhat.com Cc: Leo Yan <leo.yan@linaro.org> Subject: [PATCH v1 7/7] taskstats: Use task_is_in_root_ns() Date: Sun, 5 Dec 2021 22:51:05 +0800 Message-Id: <20211205145105.57824-8-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211205145105.57824-1-leo.yan@linaro.org> References: <20211205145105.57824-1-leo.yan@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211205_065145_853555_D3E884A4 X-CRM114-Status: GOOD ( 11.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
pid: Introduce helper task_is_in_root_ns()
|
expand
|
diff --git a/kernel/taskstats.c b/kernel/taskstats.c index 2b4898b4752e..c6a19d3911b3 100644 --- a/kernel/taskstats.c +++ b/kernel/taskstats.c @@ -284,7 +284,7 @@ static int add_del_listener(pid_t pid, const struct cpumask *mask, int isadd) if (current_user_ns() != &init_user_ns) return -EINVAL; - if (task_active_pid_ns(current) != &init_pid_ns) + if (!task_is_in_root_ns(current)) return -EINVAL; if (isadd == REGISTER) {
Replace open coded checking root PID namespace with task_is_in_root_ns(). Signed-off-by: Leo Yan <leo.yan@linaro.org> --- kernel/taskstats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)