diff options
| author | Aleksa Sarai <cyphar@cyphar.com> | 2025-08-05 15:45:08 +1000 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2025-09-02 11:37:24 +0200 |
| commit | 7df87820122acd3204565109f636a1367912655a (patch) | |
| tree | ff91f35f804b422001219c5057815b38afbf49bf /include | |
| parent | Merge patch series "vfs: if RESOLVE_NO_XDEV passed to openat2, don't *trigger... (diff) | |
| download | linux-7df87820122acd3204565109f636a1367912655a.tar.gz linux-7df87820122acd3204565109f636a1367912655a.zip | |
pidns: move is-ancestor logic to helper
This check will be needed in later patches, and there's no point
open-coding it each time.
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
Link: https://lore.kernel.org/20250805-procfs-pidns-api-v4-1-705f984940e7@cyphar.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/pid_namespace.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h index 7c67a5811199..17fdc059f8da 100644 --- a/include/linux/pid_namespace.h +++ b/include/linux/pid_namespace.h @@ -84,6 +84,9 @@ extern void zap_pid_ns_processes(struct pid_namespace *pid_ns); extern int reboot_pid_ns(struct pid_namespace *pid_ns, int cmd); extern void put_pid_ns(struct pid_namespace *ns); +extern bool pidns_is_ancestor(struct pid_namespace *child, + struct pid_namespace *ancestor); + #else /* !CONFIG_PID_NS */ #include <linux/err.h> @@ -118,6 +121,12 @@ static inline int reboot_pid_ns(struct pid_namespace *pid_ns, int cmd) { return 0; } + +static inline bool pidns_is_ancestor(struct pid_namespace *child, + struct pid_namespace *ancestor) +{ + return false; +} #endif /* CONFIG_PID_NS */ extern struct pid_namespace *task_active_pid_ns(struct task_struct *tsk); |
