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.129.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 71E08C433FE for ; Tue, 14 Dec 2021 18:23:45 +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-543-_PoPL-JiO1CK1DavGmbmJg-1; Tue, 14 Dec 2021 13:23:41 -0500 X-MC-Unique: _PoPL-JiO1CK1DavGmbmJg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 48D74185303C; Tue, 14 Dec 2021 18:23:37 +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 3205510A48D0; Tue, 14 Dec 2021 18:23:37 +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 4C1A44BB7C; Tue, 14 Dec 2021 18:23:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1BE5sis5029106 for ; Tue, 14 Dec 2021 00:54:44 -0500 Received: by smtp.corp.redhat.com (Postfix) id A36781402402; Tue, 14 Dec 2021 05:54:44 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast08.extmail.prod.ext.rdu2.redhat.com [10.11.55.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9F3F31402400 for ; Tue, 14 Dec 2021 05:54:44 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.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 7ACD23879972 for ; Tue, 14 Dec 2021 05:54:44 +0000 (UTC) Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-393-JFe9uq8UM-S0BWSE4J1TXw-1; Tue, 14 Dec 2021 00:54:40 -0500 X-MC-Unique: JFe9uq8UM-S0BWSE4J1TXw-1 Received: by mail-pl1-f177.google.com with SMTP id o14so12808048plg.5; Mon, 13 Dec 2021 21:54:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=R1Fbcs2PkAzxnxr2SD1nIRjZeiJzFKllZFg8W2MhEa4=; b=E7OkgVT/Psxq+QnGSP5MqJ6J9zUBXeHdj9FXc595g4xJF2Tx+FNZKU9XHD1MGFR+xy 9s5V/zeObLxU1XOv0sg5nO3PQnRGwpNz7/8+RTgkO63J6f2Z06rmICh/96vn8p1+m86c /UJM7rEDoywPN8Wp5yQUvWLxtmRCUjl/vpJDEdKkfRq7D+DAfuQnV++Q8PikkkeoEVVG rGzh74VdlNotuu4668XLIIvJST7dzBWKXgObfcj6t+LsIe0/G3wPyQIwHKkWsmoc4Sck faj4Ye2JzsOEuVtNA51UpHjzq7g5dxxdGqpJbuhJM8E4StQJqjL8OGkeChiGktY7a/rV X3oQ== X-Gm-Message-State: AOAM5334RphW88tO9zT92lg5pDZY7rid564go3OICjR71jLw2X6dE+Db AKI0w7PW/HYpUO5HYofdINo= X-Google-Smtp-Source: ABdhPJzmNeU8tuF6oceL4w9UBP6NmorClr6I1o6JhnvNSREoQpNWLILs9bOV3hnbB07xMd55xQ7GLQ== X-Received: by 2002:a17:902:a714:b0:143:d007:412f with SMTP id w20-20020a170902a71400b00143d007412fmr3185130plq.18.1639461279440; Mon, 13 Dec 2021 21:54:39 -0800 (PST) Received: from localhost ([110.141.142.237]) by smtp.gmail.com with ESMTPSA id l25sm11090819pgt.62.2021.12.13.21.54.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Dec 2021 21:54:38 -0800 (PST) Date: Tue, 14 Dec 2021 16:54:35 +1100 From: Balbir Singh To: Leo Yan Subject: Re: [PATCH v2 3/7] coresight: etm4x: Use task_is_in_init_pid_ns() Message-ID: References: <20211208083320.472503-1-leo.yan@linaro.org> <20211208083320.472503-4-leo.yan@linaro.org> MIME-Version: 1.0 In-Reply-To: <20211208083320.472503-4-leo.yan@linaro.org> 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.85 on 10.11.54.7 X-loop: linux-audit@redhat.com X-Mailman-Approved-At: Tue, 14 Dec 2021 13:23:33 -0500 Cc: codalist@telemann.coda.cs.cmu.edu, Jan Harkes , Leon Romanovsky , Mathieu Poirier , Suzuki K Poulose , Alexander Shishkin , netdev@vger.kernel.org, coresight@lists.linaro.org, linux-kernel@vger.kernel.org, Eric Paris , coda@cs.cmu.edu, linux-audit@redhat.com, Jakub Kicinski , "David S. Miller" , linux-arm-kernel@lists.infradead.org, Mike Leach 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.84 on 10.5.11.22 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-Disposition: inline Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Wed, Dec 08, 2021 at 04:33:16PM +0800, Leo Yan wrote: > 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 > --- > 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; > > /* Acked-by: Balbir Singh -- Linux-audit mailing list Linux-audit@redhat.com https://listman.redhat.com/mailman/listinfo/linux-audit