From patchwork Sat Dec 16 03:29:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Overstreet X-Patchwork-Id: 13495397 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BBE27C4332F for ; Sat, 16 Dec 2023 03:30:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5855F8D0147; Fri, 15 Dec 2023 22:30:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5359C8D0143; Fri, 15 Dec 2023 22:30:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 424618D0147; Fri, 15 Dec 2023 22:30:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 334B78D0143 for ; Fri, 15 Dec 2023 22:30:10 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 08095A19B7 for ; Sat, 16 Dec 2023 03:30:10 +0000 (UTC) X-FDA: 81571252980.06.251B54D Received: from out-189.mta0.migadu.com (out-189.mta0.migadu.com [91.218.175.189]) by imf24.hostedemail.com (Postfix) with ESMTP id 4DBC4180013 for ; Sat, 16 Dec 2023 03:30:08 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=MFvpTzAH; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf24.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.218.175.189 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1702697408; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ocPDVHoS7vEhw6tr2I6a+vqz6+CvzqYlQOZuWmaACjs=; b=fZUXfU9Qikl8CjTF0uA3Awgu+AJ+MK3ngZePPn66kfZCL4UCnql7FX8sajL06SG9yDmLl2 5XZNlXMiZzXoGnJRT/zgfUHRKPeQO5K/Rojlsv4NRXXvhDsEnhrMUs/tLIsb4XnMluDmFL ggIHQQqw2DcHi6ZKntN8HXlx0fIUavo= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=MFvpTzAH; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf24.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.218.175.189 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1702697408; a=rsa-sha256; cv=none; b=zsdQqC8TQrXrDGeX7GmltqNA92qjWNN4WsXvG9N4LvGiVzsFJM8+ZwXzHf+2DxPBladCre eW3SZM8dHHcMzmgaqkmSzkRIqMvxVxfaAisWNmfiV8HOgLOGIlnLEliRBwUAz7jfijMInt DHvlAF8cnCpYAfiNDZoF03CPqovHR8o= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1702697406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ocPDVHoS7vEhw6tr2I6a+vqz6+CvzqYlQOZuWmaACjs=; b=MFvpTzAHZrRy1GsWJgEbV5sUn3JBdOzPITqjc+x2YXTYOyRxMDxGyb0QcQlfWXCByyKVKk G0ZLeiQmLO2bKrCM457BFrpTL8dvQbBS8Dszx5Keykadem6YhSAfF3z/4a52vJrcMYILTh b/dEnYVIXWAmR5h3vpZWXvEStueaZm0= From: Kent Overstreet To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Cc: Kent Overstreet , tglx@linutronix.de, x86@kernel.org, tj@kernel.org, peterz@infradead.org, mathieu.desnoyers@efficios.com, paulmck@kernel.org, keescook@chromium.org, dave.hansen@linux.intel.com, mingo@redhat.com, will@kernel.org, longman@redhat.com, boqun.feng@gmail.com, brauner@kernel.org, Andy Lutomirski , Will Drewry Subject: [PATCH 22/50] pid: Split out pid_types.h Date: Fri, 15 Dec 2023 22:29:28 -0500 Message-ID: <20231216032957.3553313-1-kent.overstreet@linux.dev> In-Reply-To: <20231216024834.3510073-1-kent.overstreet@linux.dev> References: <20231216024834.3510073-1-kent.overstreet@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 4DBC4180013 X-Stat-Signature: e7t61moo7n1g1u377cqtwruuhp99gdh1 X-HE-Tag: 1702697408-816387 X-HE-Meta: U2FsdGVkX19Jat4xSxx7Gr0HSoXuO+lMjYkP2v5qzIL/2aia39wVxIzVwHYM9L6UCllAljpuofP5paHIsKkKovU0SE6EhgVzV7jKVUKA+hjWje2P2XADWzQSaLvarByyegrVYg93AesYhLQcb6n6FrSZ3mKx93OkPeTzG12DteFdVkHhgc+Pv6gsBdcLoK6qS28QgL941AZbCzhp2spTyU/bzHDVbVREY5IJh3hc1I1tjiFqDk1KzLf2pwpQBq+W9o5z8bJghwDFq8S85Pka87m9dHad+egXsWz/MB1pmh2j3DjfF3fgUYJYl8rUypqNUe7+CapV+5birWX0DYii9Q6QN6w1Aa7sAW0qE2+2MmE19qsu6opuj1IT2kLP/KpgdUmDCC998O4qGaJcdDohdbV1cjG3Ad6H3qv6tlDAVYlP+Ct4whEd8Fu/bfBpqN5UDzpLaR6HxeGaRvX5gD/rkHIdx7h3r2fxVkzh9hc/kteyuMSL/ib8zjJwhjrFEpfTJVdiVPqwqCsk+Q8CNIpsHr6IDHSAoCTS5Pp38GAhZJjhDQfT+kGL89Y53HH1MQihHfxURtp6fTPyT0zasx0rvoltIMw5LR3qWLcwr1j5rLeVNmExppzNCbNdcsuP4cmVjl0NZxMkK5MrjJXTwR252MEHMOZeRnBBD7BHNuHEcnwAUiiXzRiTslkelTWyY0pzs9ze+VXwIXyTtfoxAVwUlwdK156Y73lk8ZP8sdRBZaItemLVSpU32mDE+9uOXqmuZylrQbLufj+0r/Q/b+aNnhjK0lwVXECUgLIIVEQAazYDktEBtrqfuloairURFEFACC2D2y6KPzRDAsb0iZy+lLc16WUzGCgPWMkcadfGA7nzEUtF8G0hDy4Vvd55t+vCoeIY6qftXagCM1NqDS6U1+gvfScDLU6IKoQ9MqiPzLrszCuWE0IMjzeVkyJCkhSGkuoIOEzKdJBnTmnarW2 /T8W1bdG 1xUlcsibG0dMJ1M67h5FAR8vj9a2NiBjMizZwM8hs9GYPD5FFqA0UO/8+zWG0l7x+xzcMJBC0LrnHx3641WtALdq2un0VfPaqadaExXMMwv8xe7HZLyAnkpxHcbg61xhW5ZrGIartl0vAHlnpiwVkSxUKXnGTN8PymYU0MEPGh7sLEYdozH/5ovfj4g1v6KpCpHQDnY4SQIe4IeOBKarza2ik2sgBYJ7RT7IDxFWejTdGGQeksJu0Ddk9j6dVxpGGwh1fV0lCynFopkE+dlEtJtNjXVklBDu86cGIg6lXHKT0P4DSQLXmNN85TF7QxbTfYup0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Trimming down sched.h dependencies: we dont't want to include more than the base types. Cc: Kees Cook Cc: Andy Lutomirski Cc: Will Drewry Signed-off-by: Kent Overstreet --- drivers/target/target_core_xcopy.c | 1 + include/linux/pid.h | 15 ++------------- include/linux/pid_types.h | 16 ++++++++++++++++ include/linux/sched.h | 2 +- include/linux/seccomp.h | 2 ++ 5 files changed, 22 insertions(+), 14 deletions(-) create mode 100644 include/linux/pid_types.h diff --git a/drivers/target/target_core_xcopy.c b/drivers/target/target_core_xcopy.c index 91ed015b588c..4128631c9dfd 100644 --- a/drivers/target/target_core_xcopy.c +++ b/drivers/target/target_core_xcopy.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include diff --git a/include/linux/pid.h b/include/linux/pid.h index 653a527574c4..f254c3a45b9b 100644 --- a/include/linux/pid.h +++ b/include/linux/pid.h @@ -2,18 +2,10 @@ #ifndef _LINUX_PID_H #define _LINUX_PID_H +#include #include -#include #include - -enum pid_type -{ - PIDTYPE_PID, - PIDTYPE_TGID, - PIDTYPE_PGID, - PIDTYPE_SID, - PIDTYPE_MAX, -}; +#include /* * What is struct pid? @@ -110,9 +102,6 @@ extern void exchange_tids(struct task_struct *task, struct task_struct *old); extern void transfer_pid(struct task_struct *old, struct task_struct *new, enum pid_type); -struct pid_namespace; -extern struct pid_namespace init_pid_ns; - extern int pid_max; extern int pid_max_min, pid_max_max; diff --git a/include/linux/pid_types.h b/include/linux/pid_types.h new file mode 100644 index 000000000000..c2aee1d91dcf --- /dev/null +++ b/include/linux/pid_types.h @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_PID_TYPES_H +#define _LINUX_PID_TYPES_H + +enum pid_type { + PIDTYPE_PID, + PIDTYPE_TGID, + PIDTYPE_PGID, + PIDTYPE_SID, + PIDTYPE_MAX, +}; + +struct pid_namespace; +extern struct pid_namespace init_pid_ns; + +#endif /* _LINUX_PID_TYPES_H */ diff --git a/include/linux/sched.h b/include/linux/sched.h index 436f7ce1450a..37cc9d257073 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -11,7 +11,7 @@ #include -#include +#include #include #include #include diff --git a/include/linux/seccomp.h b/include/linux/seccomp.h index 175079552f68..1ec0d8dc4b69 100644 --- a/include/linux/seccomp.h +++ b/include/linux/seccomp.h @@ -126,6 +126,8 @@ static inline long seccomp_get_metadata(struct task_struct *task, #ifdef CONFIG_SECCOMP_CACHE_DEBUG struct seq_file; +struct pid_namespace; +struct pid; int proc_pid_seccomp_cache(struct seq_file *m, struct pid_namespace *ns, struct pid *pid, struct task_struct *task);