All of lore.kernel.org
 help / color / mirror / Atom feed
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 4/7] connector/cn_proc: Use task_is_in_root_ns() to check PID namespace
Date: Sun,  5 Dec 2021 22:51:02 +0800	[thread overview]
Message-ID: <20211205145105.57824-5-leo.yan@linaro.org> (raw)
In-Reply-To: <20211205145105.57824-1-leo.yan@linaro.org>

To avoid open code, this patch uses the helper task_is_in_root_ns() to
check if task is in root PID namespace.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
 drivers/connector/cn_proc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/connector/cn_proc.c b/drivers/connector/cn_proc.c
index 646ad385e490..b8a4fa366b28 100644
--- a/drivers/connector/cn_proc.c
+++ b/drivers/connector/cn_proc.c
@@ -358,7 +358,7 @@ static void cn_proc_mcast_ctl(struct cn_msg *msg,
 	 * other namespaces.
 	 */
 	if ((current_user_ns() != &init_user_ns) ||
-	    (task_active_pid_ns(current) != &init_pid_ns))
+	    !task_is_in_root_ns(current))
 		return;
 
 	/* Can only change if privileged. */
-- 
2.25.1


WARNING: multiple messages have this Message-ID (diff)
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 4/7] connector/cn_proc: Use task_is_in_root_ns() to check PID namespace
Date: Sun,  5 Dec 2021 22:51:02 +0800	[thread overview]
Message-ID: <20211205145105.57824-5-leo.yan@linaro.org> (raw)
In-Reply-To: <20211205145105.57824-1-leo.yan@linaro.org>

To avoid open code, this patch uses the helper task_is_in_root_ns() to
check if task is in root PID namespace.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
 drivers/connector/cn_proc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/connector/cn_proc.c b/drivers/connector/cn_proc.c
index 646ad385e490..b8a4fa366b28 100644
--- a/drivers/connector/cn_proc.c
+++ b/drivers/connector/cn_proc.c
@@ -358,7 +358,7 @@ static void cn_proc_mcast_ctl(struct cn_msg *msg,
 	 * other namespaces.
 	 */
 	if ((current_user_ns() != &init_user_ns) ||
-	    (task_active_pid_ns(current) != &init_pid_ns))
+	    !task_is_in_root_ns(current))
 		return;
 
 	/* Can only change if privileged. */
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
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@telemann.coda.cs.cmu.edu, linux-audit@redhat.com
Cc: Leo Yan <leo.yan@linaro.org>
Subject: [PATCH v1 4/7] connector/cn_proc: Use task_is_in_root_ns() to check PID namespace
Date: Sun,  5 Dec 2021 22:51:02 +0800	[thread overview]
Message-ID: <20211205145105.57824-5-leo.yan@linaro.org> (raw)
In-Reply-To: <20211205145105.57824-1-leo.yan@linaro.org>

To avoid open code, this patch uses the helper task_is_in_root_ns() to
check if task is in root PID namespace.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
 drivers/connector/cn_proc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/connector/cn_proc.c b/drivers/connector/cn_proc.c
index 646ad385e490..b8a4fa366b28 100644
--- a/drivers/connector/cn_proc.c
+++ b/drivers/connector/cn_proc.c
@@ -358,7 +358,7 @@ static void cn_proc_mcast_ctl(struct cn_msg *msg,
 	 * other namespaces.
 	 */
 	if ((current_user_ns() != &init_user_ns) ||
-	    (task_active_pid_ns(current) != &init_pid_ns))
+	    !task_is_in_root_ns(current))
 		return;
 
 	/* Can only change if privileged. */
-- 
2.25.1

--
Linux-audit mailing list
Linux-audit@redhat.com
https://listman.redhat.com/mailman/listinfo/linux-audit


  parent reply	other threads:[~2021-12-05 14:51 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-05 14:50 [PATCH v1 0/7] pid: Introduce helper task_is_in_root_ns() Leo Yan
2021-12-05 14:50 ` Leo Yan
2021-12-05 14:50 ` Leo Yan
2021-12-05 14:50 ` [PATCH v1 1/7] " Leo Yan
2021-12-05 14:50   ` Leo Yan
2021-12-05 14:50   ` Leo Yan
2021-12-06  6:49   ` Leon Romanovsky
2021-12-06  6:49     ` Leon Romanovsky
2021-12-06  6:49     ` Leon Romanovsky
2021-12-06  7:03     ` Leo Yan
2021-12-06  7:03       ` Leo Yan
2021-12-06  7:03       ` Leo Yan
2021-12-06  7:13       ` Leon Romanovsky
2021-12-06  7:13         ` Leon Romanovsky
2021-12-06  7:13         ` Leon Romanovsky
2021-12-05 14:51 ` [PATCH v1 2/7] coresight: etm3x: Use task_is_in_root_ns() to check PID namespace Leo Yan
2021-12-05 14:51   ` Leo Yan
2021-12-05 14:51   ` Leo Yan
2021-12-05 14:51 ` [PATCH v1 3/7] coresight: etm4x: " Leo Yan
2021-12-05 14:51   ` Leo Yan
2021-12-05 14:51   ` Leo Yan
2021-12-05 14:51 ` Leo Yan [this message]
2021-12-05 14:51   ` [PATCH v1 4/7] connector/cn_proc: " Leo Yan
2021-12-05 14:51   ` Leo Yan
2021-12-05 14:51 ` [PATCH v1 5/7] coda: Use task_is_in_root_ns() Leo Yan
2021-12-05 14:51   ` Leo Yan
2021-12-05 14:51   ` Leo Yan
2021-12-05 14:51 ` [PATCH v1 6/7] audit: " Leo Yan
2021-12-05 14:51   ` Leo Yan
2021-12-05 14:51   ` Leo Yan
2021-12-05 14:51 ` [PATCH v1 7/7] taskstats: " Leo Yan
2021-12-05 14:51   ` Leo Yan
2021-12-05 14:51   ` Leo Yan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211205145105.57824-5-leo.yan@linaro.org \
    --to=leo.yan@linaro.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=bsingharora@gmail.com \
    --cc=coda@cs.cmu.edu \
    --cc=codalist@coda.cs.cmu.edu \
    --cc=coresight@lists.linaro.org \
    --cc=davem@davemloft.net \
    --cc=eparis@redhat.com \
    --cc=jaharkes@cs.cmu.edu \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-audit@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=mike.leach@linaro.org \
    --cc=netdev@vger.kernel.org \
    --cc=paul@paul-moore.com \
    --cc=suzuki.poulose@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.