From: "Serge E. Hallyn" <serge@hallyn.com>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: linux-security-module@vger.kernel.org,
Casey Schaufler <casey@schaufler-ca.com>,
Paul Moore <paul@paul-moore.com>,
John Johansen <john.johansen@canonical.com>,
Kees Cook <kees@kernel.org>
Subject: Re: [PATCH 03/10] fs,kernel: Export d_absolute_path()/find_task_by_pid_ns()/find_task_by_vpid()
Date: Sat, 5 Nov 2022 18:51:11 -0500 [thread overview]
Message-ID: <20221105235111.GA23747@mail.hallyn.com> (raw)
In-Reply-To: <20221102171025.126961-3-penguin-kernel@I-love.SAKURA.ne.jp>
On Thu, Nov 03, 2022 at 02:10:18AM +0900, Tetsuo Handa wrote:
> CaitSith module which can be loaded using /sbin/insmod needs to be able to
> access these functions. TOMOYO module will also access these functions when
> CONFIG_SECURITY_TOMOYO=m becomes possible.
>
> Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> ---
> fs/d_path.c | 1 +
> kernel/pid.c | 2 ++
> 2 files changed, 3 insertions(+)
>
> diff --git a/fs/d_path.c b/fs/d_path.c
> index 56a6ee4c6331..417e74414f19 100644
> --- a/fs/d_path.c
> +++ b/fs/d_path.c
> @@ -234,6 +234,7 @@ char *d_absolute_path(const struct path *path,
> return ERR_PTR(-EINVAL);
> return extract_string(&b);
> }
> +EXPORT_SYMBOL_GPL(d_absolute_path);
>
> static void get_fs_root_rcu(struct fs_struct *fs, struct path *root)
> {
> diff --git a/kernel/pid.c b/kernel/pid.c
> index 3fbc5e46b721..9e5224d8769c 100644
> --- a/kernel/pid.c
> +++ b/kernel/pid.c
> @@ -416,11 +416,13 @@ struct task_struct *find_task_by_pid_ns(pid_t nr, struct pid_namespace *ns)
> "find_task_by_pid_ns() needs rcu_read_lock() protection");
> return pid_task(find_pid_ns(nr, ns), PIDTYPE_PID);
> }
> +EXPORT_SYMBOL_GPL(find_task_by_pid_ns);
>
> struct task_struct *find_task_by_vpid(pid_t vnr)
> {
> return find_task_by_pid_ns(vnr, task_active_pid_ns(current));
> }
> +EXPORT_SYMBOL_GPL(find_task_by_vpid);
It would be neat if you could avoid the need for these by instead using
pidfds.
> struct task_struct *find_get_task_by_vpid(pid_t nr)
> {
> --
> 2.18.4
next prev parent reply other threads:[~2022-11-05 23:51 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-02 17:10 [PATCH 01/10] security: Export security_hook_heads Tetsuo Handa
2022-11-02 17:10 ` [PATCH 02/10] mm: Export copy_to_kernel_nofault() Tetsuo Handa
2022-11-02 17:10 ` [PATCH 03/10] fs,kernel: Export d_absolute_path()/find_task_by_pid_ns()/find_task_by_vpid() Tetsuo Handa
2022-11-05 23:51 ` Serge E. Hallyn [this message]
2022-11-02 17:10 ` [PATCH 04/10] CaitSith: Add header file Tetsuo Handa
2022-11-02 17:57 ` Casey Schaufler
2022-11-05 2:43 ` Serge E. Hallyn
2022-11-05 4:05 ` Tetsuo Handa
2022-11-05 23:46 ` Serge E. Hallyn
2022-11-06 0:56 ` Tetsuo Handa
2022-11-07 18:59 ` Casey Schaufler
2022-11-08 10:18 ` Tetsuo Handa
2022-11-09 2:20 ` Paul Moore
2022-11-09 10:13 ` Tetsuo Handa
2022-11-09 14:48 ` Paul Moore
2022-11-09 23:57 ` Tetsuo Handa
2022-11-10 2:22 ` Kees Cook
2022-11-10 4:10 ` Tetsuo Handa
2022-11-10 4:45 ` Paul Moore
2022-11-07 19:22 ` Paul Moore
2022-11-02 17:10 ` [PATCH 05/10] CaitSith: Add LSM interface management file Tetsuo Handa
2022-11-02 19:05 ` Kees Cook
2022-11-02 17:10 ` [PATCH 07/10] CaitSith: Add permission checking functions Tetsuo Handa
2022-11-02 17:10 ` [PATCH 08/10] CaitSith: Add pathname calculation functions Tetsuo Handa
2022-11-02 17:10 ` [PATCH 09/10] CaitSith: Add garbage collector functions Tetsuo Handa
2022-11-02 17:10 ` [PATCH 10/10] CaitSith: Add Kconfig and Makefile files Tetsuo Handa
[not found] ` <20221102171025.126961-6-penguin-kernel@I-love.SAKURA.ne.jp>
2022-11-02 17:29 ` [PATCH 6a/10] CaitSith: Add policy management functions Tetsuo Handa
2022-11-02 17:29 ` [PATCH 6b/10] " Tetsuo Handa
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=20221105235111.GA23747@mail.hallyn.com \
--to=serge@hallyn.com \
--cc=casey@schaufler-ca.com \
--cc=john.johansen@canonical.com \
--cc=kees@kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=paul@paul-moore.com \
--cc=penguin-kernel@I-love.SAKURA.ne.jp \
/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;
as well as URLs for NNTP newsgroup(s).