From: Leo Yan <leo.yan@linaro.org>
To: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Leon Romanovsky <leon@kernel.org>,
Balbir Singh <bsingharora@gmail.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Leo Yan <leo.yan@linaro.org>
Subject: [PATCH net v3 2/2] connector/cn_proc: Use task_is_in_init_pid_ns()
Date: Wed, 26 Jan 2022 13:04:27 +0800 [thread overview]
Message-ID: <20220126050427.605628-3-leo.yan@linaro.org> (raw)
In-Reply-To: <20220126050427.605628-1-leo.yan@linaro.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 <leo.yan@linaro.org>
Acked-by: Balbir Singh <bsingharora@gmail.com>
---
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..ccac1c453080 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_init_pid_ns(current))
return;
/* Can only change if privileged. */
--
2.25.1
next prev parent reply other threads:[~2022-01-26 5:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-26 5:04 [PATCH net v3 0/2] pid: Introduce helper task_is_in_root_ns() Leo Yan
2022-01-26 5:04 ` [PATCH net v3 1/2] pid: Introduce helper task_is_in_init_pid_ns() Leo Yan
2022-01-26 5:04 ` Leo Yan [this message]
2022-01-27 3:10 ` [PATCH net v3 0/2] pid: Introduce helper task_is_in_root_ns() patchwork-bot+netdevbpf
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=20220126050427.605628-3-leo.yan@linaro.org \
--to=leo.yan@linaro.org \
--cc=bsingharora@gmail.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®