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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25DAFC433EF for ; Fri, 4 Feb 2022 13:51:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359024AbiBDNvZ (ORCPT ); Fri, 4 Feb 2022 08:51:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359038AbiBDNvU (ORCPT ); Fri, 4 Feb 2022 08:51:20 -0500 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 513EAC06173D for ; Fri, 4 Feb 2022 05:51:20 -0800 (PST) Received: by mail-pl1-x631.google.com with SMTP id c9so5180261plg.11 for ; Fri, 04 Feb 2022 05:51:20 -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=gYlHTKZwf3eLsDFK6/setIM6v4QyZpE5drcppDSgIrA=; b=pC1m2fQqzS3hTahuKDM+7c0QgFbpmg/lU10YDP/xIO9xlFrADUvnPyylLcudQm3HwS Mzkkzt+rfEVA3WC0spzFoQljr9eb513PHecSpght3nP9WlMtWD82drPNmjTwj2mvE4Hw dda8ht3nPEpJgAN2CREnIOfJRLXHjHbQeB2ZhAblgc8q7hxEozF3onzdmNId7clG2bjG ZEcuTQGcQ4c13Pw562dtlPFppp2B2IJWZZ37JZn5MAfn6uEuGdVTV77pnXlo4nMI3f7Z 5DK0AovtSLJeoY5vHqtvQx1s9VVbD+XNEoRLYXqeTTG7T9xy4bGxsPnJg085fug37uZQ 5CBA== 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=gYlHTKZwf3eLsDFK6/setIM6v4QyZpE5drcppDSgIrA=; b=oAYqKXVpi6ULAlBptybGVwdy8CwtzW1KM7Z8uX9aJMHLfnMXr3GIA4nBZcHmtWLC9u iuAyvVKlfKGKEuVjHSvs83eTTIjJwQ1mjU4hYXlUUMV0uCHgsARTuG8OnjeE1HJVf/0X KvduiST16KEOtvXvmWWIWLxQcLAHpNhdGmhIbz5R8QQ0fKMEMheRy0xFQObSqdfVU2kZ L5xjgDHXugDx3/m6Y46ubSsU0bGNj2W3ciIAdXCzbkrGNtewH2pcGPwSjMqa6opm07Vi v5O4CsBwbWFVK9BwOV0CuKGQqMCXAf0qN5jM36xHppZshpFLFTWQIW/cWBvEQFp3eTjY fXuA== X-Gm-Message-State: AOAM531iBFpPm7gaZMHeyFv52B/XYHIaPgGkrsjmH3Kzzuh7EOkK5dt9 xYUkjI7cYFbas0M9n8HoCcvPTg== X-Google-Smtp-Source: ABdhPJy/zWH1p1cq5ydscrQgno2r1v4rJtuFkahMNvFLmLQ8bff4NDmYnoTUSpUlIlE29DeDFErTXQ== X-Received: by 2002:a17:90a:f485:: with SMTP id bx5mr3247440pjb.46.1643982679691; Fri, 04 Feb 2022 05:51:19 -0800 (PST) Received: from localhost.localdomain ([134.195.101.46]) by smtp.gmail.com with ESMTPSA id 13sm2668131pfm.161.2022.02.04.05.51.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Feb 2022 05:51:19 -0800 (PST) From: Leo Yan To: Mathieu Poirier , Suzuki K Poulose , Mike Leach , Alexander Shishkin , Jan Harkes , coda@cs.cmu.edu, Paul Moore , Eric Paris , Balbir Singh , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, codalist@coda.cs.cmu.edu, linux-audit@redhat.com Cc: Leo Yan Subject: [PATCH v4 2/5] coresight: etm4x: Use task_is_in_init_pid_ns() Date: Fri, 4 Feb 2022 21:50:48 +0800 Message-Id: <20220204135051.60639-3-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220204135051.60639-1-leo.yan@linaro.org> References: <20220204135051.60639-1-leo.yan@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch replaces open code with task_is_in_init_pid_ns() to check if a task is in root PID namespace. Signed-off-by: Leo Yan Reviewed-by: Suzuki K Poulose Acked-by: Balbir Singh --- drivers/hwtracing/coresight/coresight-etm4x-sysfs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c b/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c index a0640fa5c55b..10ef2a29006e 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c +++ b/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c @@ -1890,7 +1890,7 @@ static ssize_t ctxid_pid_show(struct device *dev, * Don't use contextID tracing if coming from a PID namespace. See * comment in ctxid_pid_store(). */ - if (task_active_pid_ns(current) != &init_pid_ns) + if (!task_is_in_init_pid_ns(current)) return -EINVAL; spin_lock(&drvdata->spinlock); @@ -1918,7 +1918,7 @@ static ssize_t ctxid_pid_store(struct device *dev, * As such refuse to use the feature if @current is not in the initial * PID namespace. */ - if (task_active_pid_ns(current) != &init_pid_ns) + if (!task_is_in_init_pid_ns(current)) return -EINVAL; /* @@ -1951,7 +1951,7 @@ static ssize_t ctxid_masks_show(struct device *dev, * Don't use contextID tracing if coming from a PID namespace. See * comment in ctxid_pid_store(). */ - if (task_active_pid_ns(current) != &init_pid_ns) + if (!task_is_in_init_pid_ns(current)) return -EINVAL; spin_lock(&drvdata->spinlock); @@ -1975,7 +1975,7 @@ static ssize_t ctxid_masks_store(struct device *dev, * Don't use contextID tracing if coming from a PID namespace. See * comment in ctxid_pid_store(). */ - if (task_active_pid_ns(current) != &init_pid_ns) + if (!task_is_in_init_pid_ns(current)) return -EINVAL; /* -- 2.25.1 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 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 06EB3C433EF for ; Fri, 4 Feb 2022 13:52:53 +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=m8Zm9smoZfi35/3IO90E/+9OI6DECyB+rVhPkxjfEfg=; b=dz76CS/pxXR/qi XpY12n5AHJaPgbf9TXZY/FELlss1hLLF4rN5BKt2QkEEvaPPE8Iyd+QsKRkgmB5C9EUC6FXwGqMSN pHcocgBMhGr8pvmEawAewgCVBkymQeiFL2feWrFHZRlfh8LA7Og0ErMXCDipOag8YJ1hNuzbha0XH Jw4pfiyczsuq4Ocb4Nq2C1F3H4IQZBnJW5vgDZmVxJzH5umy2PIrrA2xxMlaDtxDa+U+b+/u4Wemq 7cu0LIUVG6yCmmySb2AnJNIH6saPIhGaRQTEfvFT2ug7UXKmZu0vOpxqzYPI6guZ8mLXpHpMhrd2v /A0uATuoTGqwbOc0sZ4A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFyzx-004Rdz-AK; Fri, 04 Feb 2022 13:51:37 +0000 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFyzg-004RZG-UD for linux-arm-kernel@lists.infradead.org; Fri, 04 Feb 2022 13:51:22 +0000 Received: by mail-pl1-x62f.google.com with SMTP id t9so2984462plg.13 for ; Fri, 04 Feb 2022 05:51:20 -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=gYlHTKZwf3eLsDFK6/setIM6v4QyZpE5drcppDSgIrA=; b=pC1m2fQqzS3hTahuKDM+7c0QgFbpmg/lU10YDP/xIO9xlFrADUvnPyylLcudQm3HwS Mzkkzt+rfEVA3WC0spzFoQljr9eb513PHecSpght3nP9WlMtWD82drPNmjTwj2mvE4Hw dda8ht3nPEpJgAN2CREnIOfJRLXHjHbQeB2ZhAblgc8q7hxEozF3onzdmNId7clG2bjG ZEcuTQGcQ4c13Pw562dtlPFppp2B2IJWZZ37JZn5MAfn6uEuGdVTV77pnXlo4nMI3f7Z 5DK0AovtSLJeoY5vHqtvQx1s9VVbD+XNEoRLYXqeTTG7T9xy4bGxsPnJg085fug37uZQ 5CBA== 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=gYlHTKZwf3eLsDFK6/setIM6v4QyZpE5drcppDSgIrA=; b=EbfGk6p0wprvsVleCUgUz/4Cu5z1YfCw62xTt4g+RFS8H9csP9tYkqD3gqahewyrfw PczJrKFMorzHmKhw1ZCf64is29hGsgx+DGRMvkYadEodYKjFUMJgnsqmdAvkzoTC+OeK naSbpBo6Tw/XXxtd3siGfuR3AQFOv7uapT6czgM/WFaifFTFvtNttKg5LFPnfm6+rjIM GHOGO5MwxLxRe0w/ZPArfNoWqJYjU0YyV3JFiJLvu/APWHszQ3BllTkqVo5yJm+yPNUJ DuoFI3918T5iIc0ThXKGdgVTJYposqriYyRVZc7BycIR20luv67/GWX4ZbdAp9v5DC9T t48A== X-Gm-Message-State: AOAM533eAGtpluPV4AH+sAi1AK09cfZZqQQYx4tyvcZae5nzlIhrvnpy Z/yHcgyJXhFbcOmjeKX6bsHxRQ== X-Google-Smtp-Source: ABdhPJy/zWH1p1cq5ydscrQgno2r1v4rJtuFkahMNvFLmLQ8bff4NDmYnoTUSpUlIlE29DeDFErTXQ== X-Received: by 2002:a17:90a:f485:: with SMTP id bx5mr3247440pjb.46.1643982679691; Fri, 04 Feb 2022 05:51:19 -0800 (PST) Received: from localhost.localdomain ([134.195.101.46]) by smtp.gmail.com with ESMTPSA id 13sm2668131pfm.161.2022.02.04.05.51.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Feb 2022 05:51:19 -0800 (PST) From: Leo Yan To: Mathieu Poirier , Suzuki K Poulose , Mike Leach , Alexander Shishkin , Jan Harkes , coda@cs.cmu.edu, Paul Moore , Eric Paris , Balbir Singh , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, codalist@coda.cs.cmu.edu, linux-audit@redhat.com Cc: Leo Yan Subject: [PATCH v4 2/5] coresight: etm4x: Use task_is_in_init_pid_ns() Date: Fri, 4 Feb 2022 21:50:48 +0800 Message-Id: <20220204135051.60639-3-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220204135051.60639-1-leo.yan@linaro.org> References: <20220204135051.60639-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-20220204_055121_001099_F25F9A81 X-CRM114-Status: GOOD ( 11.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This patch replaces open code with task_is_in_init_pid_ns() to check if a task is in root PID namespace. Signed-off-by: Leo Yan Reviewed-by: Suzuki K Poulose Acked-by: Balbir Singh --- drivers/hwtracing/coresight/coresight-etm4x-sysfs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c b/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c index a0640fa5c55b..10ef2a29006e 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c +++ b/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c @@ -1890,7 +1890,7 @@ static ssize_t ctxid_pid_show(struct device *dev, * Don't use contextID tracing if coming from a PID namespace. See * comment in ctxid_pid_store(). */ - if (task_active_pid_ns(current) != &init_pid_ns) + if (!task_is_in_init_pid_ns(current)) return -EINVAL; spin_lock(&drvdata->spinlock); @@ -1918,7 +1918,7 @@ static ssize_t ctxid_pid_store(struct device *dev, * As such refuse to use the feature if @current is not in the initial * PID namespace. */ - if (task_active_pid_ns(current) != &init_pid_ns) + if (!task_is_in_init_pid_ns(current)) return -EINVAL; /* @@ -1951,7 +1951,7 @@ static ssize_t ctxid_masks_show(struct device *dev, * Don't use contextID tracing if coming from a PID namespace. See * comment in ctxid_pid_store(). */ - if (task_active_pid_ns(current) != &init_pid_ns) + if (!task_is_in_init_pid_ns(current)) return -EINVAL; spin_lock(&drvdata->spinlock); @@ -1975,7 +1975,7 @@ static ssize_t ctxid_masks_store(struct device *dev, * Don't use contextID tracing if coming from a PID namespace. See * comment in ctxid_pid_store(). */ - if (task_active_pid_ns(current) != &init_pid_ns) + if (!task_is_in_init_pid_ns(current)) return -EINVAL; /* -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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 us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 10EE1C433EF for ; Fri, 4 Feb 2022 14:09:19 +0000 (UTC) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-602-s2j8S2DrNXezoAt6Q_2eZg-1; Fri, 04 Feb 2022 09:09:15 -0500 X-MC-Unique: s2j8S2DrNXezoAt6Q_2eZg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CC94184DA40; Fri, 4 Feb 2022 14:09:11 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A72DE7C0D8; Fri, 4 Feb 2022 14:09:11 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 6887D4CA93; Fri, 4 Feb 2022 14:09:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 214DpQOF031213 for ; Fri, 4 Feb 2022 08:51:26 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0DA031120ABD; Fri, 4 Feb 2022 13:51:26 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 09AE41120ABB for ; Fri, 4 Feb 2022 13:51:22 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7B1E7185A7BA for ; Fri, 4 Feb 2022 13:51:22 +0000 (UTC) Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-10-cIY254JyOAKSRcP9t43eTQ-1; Fri, 04 Feb 2022 08:51:20 -0500 X-MC-Unique: cIY254JyOAKSRcP9t43eTQ-1 Received: by mail-pj1-f45.google.com with SMTP id g15-20020a17090a67cf00b001b7d5b6bedaso6163135pjm.4 for ; Fri, 04 Feb 2022 05:51:20 -0800 (PST) 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=gYlHTKZwf3eLsDFK6/setIM6v4QyZpE5drcppDSgIrA=; b=FBE8s0PLqWO82YCkutcfVe+B4S3hUQomCsUf5s6+haWbMcLi3ucvLJHeiAkeKu7ZVu nM95fNS0dzEnKxA6c348bqmsvwiFCTNiwv6bLthASA6dQ1WKmF8QQalskUlAnYmWPrgG z6A64YVzuP/NKa2DvnAG3f7SUzGihziGVrb1fE36zqDvPXAidCCtyRsoUMjJeEV8Dpv1 gim9VED1jnby0SYpXAxmVgC8ew+b1efmOPXrc8XtULGkTay7Hi81gDgbd7cnsAnqo1pR /4UMf/av4QKJtZ2ZCvUYFODf0lGsiAGeXeGKmfWN1IKH7R1wI/6gcCLrn5pVeNA12jNR RvQg== X-Gm-Message-State: AOAM533JuC5ZpIFNDrL3d2hac+EnuVzz3SO3lcFmcOyuy+boptRErKRT L4j+I+8wIx3wK726SV2YISNuMg== X-Google-Smtp-Source: ABdhPJy/zWH1p1cq5ydscrQgno2r1v4rJtuFkahMNvFLmLQ8bff4NDmYnoTUSpUlIlE29DeDFErTXQ== X-Received: by 2002:a17:90a:f485:: with SMTP id bx5mr3247440pjb.46.1643982679691; Fri, 04 Feb 2022 05:51:19 -0800 (PST) Received: from localhost.localdomain ([134.195.101.46]) by smtp.gmail.com with ESMTPSA id 13sm2668131pfm.161.2022.02.04.05.51.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Feb 2022 05:51:19 -0800 (PST) From: Leo Yan To: Mathieu Poirier , Suzuki K Poulose , Mike Leach , Alexander Shishkin , Jan Harkes , coda@cs.cmu.edu, Paul Moore , Eric Paris , Balbir Singh , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, codalist@telemann.coda.cs.cmu.edu, linux-audit@redhat.com Subject: [PATCH v4 2/5] coresight: etm4x: Use task_is_in_init_pid_ns() Date: Fri, 4 Feb 2022 21:50:48 +0800 Message-Id: <20220204135051.60639-3-leo.yan@linaro.org> In-Reply-To: <20220204135051.60639-1-leo.yan@linaro.org> References: <20220204135051.60639-1-leo.yan@linaro.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: linux-audit@redhat.com X-Mailman-Approved-At: Fri, 04 Feb 2022 09:01:32 -0500 Cc: Leo Yan X-BeenThere: linux-audit@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Linux Audit Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=linux-audit-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit This patch replaces open code with task_is_in_init_pid_ns() to check if a task is in root PID namespace. Signed-off-by: Leo Yan Reviewed-by: Suzuki K Poulose Acked-by: Balbir Singh --- drivers/hwtracing/coresight/coresight-etm4x-sysfs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c b/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c index a0640fa5c55b..10ef2a29006e 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c +++ b/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c @@ -1890,7 +1890,7 @@ static ssize_t ctxid_pid_show(struct device *dev, * Don't use contextID tracing if coming from a PID namespace. See * comment in ctxid_pid_store(). */ - if (task_active_pid_ns(current) != &init_pid_ns) + if (!task_is_in_init_pid_ns(current)) return -EINVAL; spin_lock(&drvdata->spinlock); @@ -1918,7 +1918,7 @@ static ssize_t ctxid_pid_store(struct device *dev, * As such refuse to use the feature if @current is not in the initial * PID namespace. */ - if (task_active_pid_ns(current) != &init_pid_ns) + if (!task_is_in_init_pid_ns(current)) return -EINVAL; /* @@ -1951,7 +1951,7 @@ static ssize_t ctxid_masks_show(struct device *dev, * Don't use contextID tracing if coming from a PID namespace. See * comment in ctxid_pid_store(). */ - if (task_active_pid_ns(current) != &init_pid_ns) + if (!task_is_in_init_pid_ns(current)) return -EINVAL; spin_lock(&drvdata->spinlock); @@ -1975,7 +1975,7 @@ static ssize_t ctxid_masks_store(struct device *dev, * Don't use contextID tracing if coming from a PID namespace. See * comment in ctxid_pid_store(). */ - if (task_active_pid_ns(current) != &init_pid_ns) + if (!task_is_in_init_pid_ns(current)) return -EINVAL; /* -- 2.25.1 -- Linux-audit mailing list Linux-audit@redhat.com https://listman.redhat.com/mailman/listinfo/linux-audit