]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
copy_process: pass clone_flags as u64 across calltree
authorSimon Schuster <schuster.simon@siemens-energy.com>
Mon, 1 Sep 2025 13:09:51 +0000 (15:09 +0200)
committerChristian Brauner <brauner@kernel.org>
Mon, 1 Sep 2025 13:31:34 +0000 (15:31 +0200)
With the introduction of clone3 in commit 7f192e3cd316 ("fork: add
clone3") the effective bit width of clone_flags on all architectures was
increased from 32-bit to 64-bit, with a new type of u64 for the flags.
However, for most consumers of clone_flags the interface was not
changed from the previous type of unsigned long.

While this works fine as long as none of the new 64-bit flag bits
(CLONE_CLEAR_SIGHAND and CLONE_INTO_CGROUP) are evaluated, this is still
undesirable in terms of the principle of least surprise.

Thus, this commit fixes all relevant interfaces of callees to
sys_clone3/copy_process (excluding the architecture-specific
copy_thread) to consistently pass clone_flags as u64, so that
no truncation to 32-bit integers occurs on 32-bit architectures.

Signed-off-by: Simon Schuster <schuster.simon@siemens-energy.com>
Link: https://lore.kernel.org/20250901-nios2-implement-clone3-v2-2-53fcf5577d57@siemens-energy.com
Acked-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Christian Brauner <brauner@kernel.org>
38 files changed:
block/blk-ioc.c
fs/namespace.c
include/linux/cgroup.h
include/linux/cred.h
include/linux/iocontext.h
include/linux/ipc_namespace.h
include/linux/lsm_hook_defs.h
include/linux/mnt_namespace.h
include/linux/nsproxy.h
include/linux/pid_namespace.h
include/linux/rseq.h
include/linux/sched/task.h
include/linux/security.h
include/linux/sem.h
include/linux/time_namespace.h
include/linux/uprobes.h
include/linux/user_events.h
include/linux/utsname.h
include/net/net_namespace.h
include/trace/events/task.h
ipc/namespace.c
ipc/sem.c
kernel/cgroup/namespace.c
kernel/cred.c
kernel/events/uprobes.c
kernel/fork.c
kernel/nsproxy.c
kernel/pid_namespace.c
kernel/sched/core.c
kernel/sched/fair.c
kernel/sched/sched.h
kernel/time/namespace.c
kernel/utsname.c
net/core/net_namespace.c
security/apparmor/lsm.c
security/security.c
security/selinux/hooks.c
security/tomoyo/tomoyo.c

index 9fda3906e5f5d6c5a51378cfc42ec74c776975f4..d15918d7fabb33fb8e07ab98ef37b3385bd76d0b 100644 (file)
@@ -286,7 +286,7 @@ out:
 }
 EXPORT_SYMBOL_GPL(set_task_ioprio);
 
-int __copy_io(unsigned long clone_flags, struct task_struct *tsk)
+int __copy_io(u64 clone_flags, struct task_struct *tsk)
 {
        struct io_context *ioc = current->io_context;
 
index ddfd4457d338372a6ee88f2fc54075eab25be3a8..d9c190ffa7df8f9cdae59ba09df6e1aee675c2f8 100644 (file)
@@ -4200,7 +4200,7 @@ static struct mnt_namespace *alloc_mnt_ns(struct user_namespace *user_ns, bool a
 }
 
 __latent_entropy
-struct mnt_namespace *copy_mnt_ns(unsigned long flags, struct mnt_namespace *ns,
+struct mnt_namespace *copy_mnt_ns(u64 flags, struct mnt_namespace *ns,
                struct user_namespace *user_ns, struct fs_struct *new_fs)
 {
        struct mnt_namespace *new_ns;
index b18fb5fcb38e239347c1be4b5af9f74f14c767c4..56d9556a181a82a14332a90e7d8226ebfd3f41b0 100644 (file)
@@ -796,7 +796,7 @@ extern struct cgroup_namespace init_cgroup_ns;
 
 void free_cgroup_ns(struct cgroup_namespace *ns);
 
-struct cgroup_namespace *copy_cgroup_ns(unsigned long flags,
+struct cgroup_namespace *copy_cgroup_ns(u64 flags,
                                        struct user_namespace *user_ns,
                                        struct cgroup_namespace *old_ns);
 
@@ -818,7 +818,7 @@ static inline void put_cgroup_ns(struct cgroup_namespace *ns)
 
 static inline void free_cgroup_ns(struct cgroup_namespace *ns) { }
 static inline struct cgroup_namespace *
-copy_cgroup_ns(unsigned long flags, struct user_namespace *user_ns,
+copy_cgroup_ns(u64 flags, struct user_namespace *user_ns,
               struct cgroup_namespace *old_ns)
 {
        return old_ns;
index a102a10f833fb8301c207d39f4c5c367615251c7..89ae50ad2acea987b107e94cae55e3a716f66ac9 100644 (file)
@@ -148,7 +148,7 @@ struct cred {
 
 extern void __put_cred(struct cred *);
 extern void exit_creds(struct task_struct *);
-extern int copy_creds(struct task_struct *, unsigned long);
+extern int copy_creds(struct task_struct *, u64);
 extern const struct cred *get_task_cred(struct task_struct *);
 extern struct cred *cred_alloc_blank(void);
 extern struct cred *prepare_creds(void);
index 14f7eaf1b4437c4db64218f6720be961db09cc25..079d8773790c07bed78b2cbc4eda3f2ca8d130ab 100644 (file)
@@ -118,8 +118,8 @@ struct task_struct;
 #ifdef CONFIG_BLOCK
 void put_io_context(struct io_context *ioc);
 void exit_io_context(struct task_struct *task);
-int __copy_io(unsigned long clone_flags, struct task_struct *tsk);
-static inline int copy_io(unsigned long clone_flags, struct task_struct *tsk)
+int __copy_io(u64 clone_flags, struct task_struct *tsk);
+static inline int copy_io(u64 clone_flags, struct task_struct *tsk)
 {
        if (!current->io_context)
                return 0;
@@ -129,7 +129,7 @@ static inline int copy_io(unsigned long clone_flags, struct task_struct *tsk)
 struct io_context;
 static inline void put_io_context(struct io_context *ioc) { }
 static inline void exit_io_context(struct task_struct *task) { }
-static inline int copy_io(unsigned long clone_flags, struct task_struct *tsk)
+static inline int copy_io(u64 clone_flags, struct task_struct *tsk)
 {
        return 0;
 }
index e8240cf2611ad63f427d8fe90b3fe8cbcb1fb6b0..4b399893e2b3c62019ddb2dab0bc10c3a2925735 100644 (file)
@@ -129,7 +129,7 @@ static inline int mq_init_ns(struct ipc_namespace *ns) { return 0; }
 #endif
 
 #if defined(CONFIG_IPC_NS)
-extern struct ipc_namespace *copy_ipcs(unsigned long flags,
+extern struct ipc_namespace *copy_ipcs(u64 flags,
        struct user_namespace *user_ns, struct ipc_namespace *ns);
 
 static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns)
@@ -151,7 +151,7 @@ static inline struct ipc_namespace *get_ipc_ns_not_zero(struct ipc_namespace *ns
 
 extern void put_ipc_ns(struct ipc_namespace *ns);
 #else
-static inline struct ipc_namespace *copy_ipcs(unsigned long flags,
+static inline struct ipc_namespace *copy_ipcs(u64 flags,
        struct user_namespace *user_ns, struct ipc_namespace *ns)
 {
        if (flags & CLONE_NEWIPC)
index fd11fffdd3c38045eafe6ebd20b77a1fc8a7a74f..adbe234a6f6c617438420889f59e46c1bca468c3 100644 (file)
@@ -211,7 +211,7 @@ LSM_HOOK(int, 0, file_open, struct file *file)
 LSM_HOOK(int, 0, file_post_open, struct file *file, int mask)
 LSM_HOOK(int, 0, file_truncate, struct file *file)
 LSM_HOOK(int, 0, task_alloc, struct task_struct *task,
-        unsigned long clone_flags)
+        u64 clone_flags)
 LSM_HOOK(void, LSM_RET_VOID, task_free, struct task_struct *task)
 LSM_HOOK(int, 0, cred_alloc_blank, struct cred *cred, gfp_t gfp)
 LSM_HOOK(void, LSM_RET_VOID, cred_free, struct cred *cred)
index 70b366b64816056618702e418a80d181fa51a746..ff290c87b2e7d9a2007626d5db468376e3cae024 100644 (file)
@@ -11,7 +11,7 @@ struct fs_struct;
 struct user_namespace;
 struct ns_common;
 
-extern struct mnt_namespace *copy_mnt_ns(unsigned long, struct mnt_namespace *,
+extern struct mnt_namespace *copy_mnt_ns(u64, struct mnt_namespace *,
                struct user_namespace *, struct fs_struct *);
 extern void put_mnt_ns(struct mnt_namespace *ns);
 DEFINE_FREE(put_mnt_ns, struct mnt_namespace *, if (!IS_ERR_OR_NULL(_T)) put_mnt_ns(_T))
index dab6a1734a2265d4e75997a9da00810a7ef832ec..82533e899ff4fa643d561ac8fa4410fef214290f 100644 (file)
@@ -103,7 +103,7 @@ static inline struct cred *nsset_cred(struct nsset *set)
  *
  */
 
-int copy_namespaces(unsigned long flags, struct task_struct *tsk);
+int copy_namespaces(u64 flags, struct task_struct *tsk);
 void exit_task_namespaces(struct task_struct *tsk);
 void switch_task_namespaces(struct task_struct *tsk, struct nsproxy *new);
 int exec_task_namespaces(void);
index 7c67a58111998d9bcb1ba29c017acb249286ec38..0620a3e08e831199c1f8e646261e0176965330f2 100644 (file)
@@ -78,7 +78,7 @@ static inline int pidns_memfd_noexec_scope(struct pid_namespace *ns)
 }
 #endif
 
-extern struct pid_namespace *copy_pid_ns(unsigned long flags,
+extern struct pid_namespace *copy_pid_ns(u64 flags,
        struct user_namespace *user_ns, struct pid_namespace *ns);
 extern void zap_pid_ns_processes(struct pid_namespace *pid_ns);
 extern int reboot_pid_ns(struct pid_namespace *pid_ns, int cmd);
@@ -97,7 +97,7 @@ static inline int pidns_memfd_noexec_scope(struct pid_namespace *ns)
        return 0;
 }
 
-static inline struct pid_namespace *copy_pid_ns(unsigned long flags,
+static inline struct pid_namespace *copy_pid_ns(u64 flags,
        struct user_namespace *user_ns, struct pid_namespace *ns)
 {
        if (flags & CLONE_NEWPID)
index bc8af3eb5598768ac46d250bb0e5583f0a971a06..a96fd345aa381007b4efe1a6f31c1242cd11c3f3 100644 (file)
@@ -65,7 +65,7 @@ static inline void rseq_migrate(struct task_struct *t)
  * If parent process has a registered restartable sequences area, the
  * child inherits. Unregister rseq for a clone with CLONE_VM set.
  */
-static inline void rseq_fork(struct task_struct *t, unsigned long clone_flags)
+static inline void rseq_fork(struct task_struct *t, u64 clone_flags)
 {
        if (clone_flags & CLONE_VM) {
                t->rseq = NULL;
@@ -107,7 +107,7 @@ static inline void rseq_preempt(struct task_struct *t)
 static inline void rseq_migrate(struct task_struct *t)
 {
 }
-static inline void rseq_fork(struct task_struct *t, unsigned long clone_flags)
+static inline void rseq_fork(struct task_struct *t, u64 clone_flags)
 {
 }
 static inline void rseq_execve(struct task_struct *t)
index ea41795a352bcad044f9d74ab2d331ca60a37ff5..34d6a0e108c3e66cd80d8a6b7a73be377713bc5d 100644 (file)
@@ -63,7 +63,7 @@ extern int lockdep_tasklist_lock_is_held(void);
 extern asmlinkage void schedule_tail(struct task_struct *prev);
 extern void init_idle(struct task_struct *idle, int cpu);
 
-extern int sched_fork(unsigned long clone_flags, struct task_struct *p);
+extern int sched_fork(u64 clone_flags, struct task_struct *p);
 extern int sched_cgroup_fork(struct task_struct *p, struct kernel_clone_args *kargs);
 extern void sched_cancel_fork(struct task_struct *p);
 extern void sched_post_fork(struct task_struct *p);
index 521bcb5b97170c7f9b0abd79fc6fe756d4ff29ee..9a1d4a6c867380c84f5ebff617a3d267759ab695 100644 (file)
@@ -489,7 +489,7 @@ int security_file_receive(struct file *file);
 int security_file_open(struct file *file);
 int security_file_post_open(struct file *file, int mask);
 int security_file_truncate(struct file *file);
-int security_task_alloc(struct task_struct *task, unsigned long clone_flags);
+int security_task_alloc(struct task_struct *task, u64 clone_flags);
 void security_task_free(struct task_struct *task);
 int security_cred_alloc_blank(struct cred *cred, gfp_t gfp);
 void security_cred_free(struct cred *cred);
@@ -1215,7 +1215,7 @@ static inline int security_file_truncate(struct file *file)
 }
 
 static inline int security_task_alloc(struct task_struct *task,
-                                     unsigned long clone_flags)
+                                     u64 clone_flags)
 {
        return 0;
 }
index c4deefe42aeb3ceca7f739298b460f668f5b3515..275269ce2ec89287c28cd9372e68afb9b2f931ee 100644 (file)
@@ -9,12 +9,12 @@ struct task_struct;
 
 #ifdef CONFIG_SYSVIPC
 
-extern int copy_semundo(unsigned long clone_flags, struct task_struct *tsk);
+extern int copy_semundo(u64 clone_flags, struct task_struct *tsk);
 extern void exit_sem(struct task_struct *tsk);
 
 #else
 
-static inline int copy_semundo(unsigned long clone_flags, struct task_struct *tsk)
+static inline int copy_semundo(u64 clone_flags, struct task_struct *tsk)
 {
        return 0;
 }
index bb2c52f4fc9497881a436b4a0eb4773864faa2bc..b6e36525e0be4dd47d63d532abac3a02a459826a 100644 (file)
@@ -43,7 +43,7 @@ static inline struct time_namespace *get_time_ns(struct time_namespace *ns)
        return ns;
 }
 
-struct time_namespace *copy_time_ns(unsigned long flags,
+struct time_namespace *copy_time_ns(u64 flags,
                                    struct user_namespace *user_ns,
                                    struct time_namespace *old_ns);
 void free_time_ns(struct time_namespace *ns);
@@ -129,7 +129,7 @@ static inline void put_time_ns(struct time_namespace *ns)
 }
 
 static inline
-struct time_namespace *copy_time_ns(unsigned long flags,
+struct time_namespace *copy_time_ns(u64 flags,
                                    struct user_namespace *user_ns,
                                    struct time_namespace *old_ns)
 {
index 516217c390946cf70bb8568893508623dfa4380d..915303a82d846fe9da1258ed2acc95ffa0f96840 100644 (file)
@@ -205,7 +205,7 @@ extern void uprobe_start_dup_mmap(void);
 extern void uprobe_end_dup_mmap(void);
 extern void uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm);
 extern void uprobe_free_utask(struct task_struct *t);
-extern void uprobe_copy_process(struct task_struct *t, unsigned long flags);
+extern void uprobe_copy_process(struct task_struct *t, u64 flags);
 extern int uprobe_post_sstep_notifier(struct pt_regs *regs);
 extern int uprobe_pre_sstep_notifier(struct pt_regs *regs);
 extern void uprobe_notify_resume(struct pt_regs *regs);
@@ -281,7 +281,7 @@ static inline bool uprobe_deny_signal(void)
 static inline void uprobe_free_utask(struct task_struct *t)
 {
 }
-static inline void uprobe_copy_process(struct task_struct *t, unsigned long flags)
+static inline void uprobe_copy_process(struct task_struct *t, u64 flags)
 {
 }
 static inline void uprobe_clear_state(struct mm_struct *mm)
index 8afa8c3a097308854b50f2fdde6ba727e20b162b..57d1ff0060901a897dec38b1c799a0b534815b29 100644 (file)
@@ -33,7 +33,7 @@ extern void user_event_mm_dup(struct task_struct *t,
 extern void user_event_mm_remove(struct task_struct *t);
 
 static inline void user_events_fork(struct task_struct *t,
-                                   unsigned long clone_flags)
+                                   u64 clone_flags)
 {
        struct user_event_mm *old_mm;
 
@@ -68,7 +68,7 @@ static inline void user_events_exit(struct task_struct *t)
 }
 #else
 static inline void user_events_fork(struct task_struct *t,
-                                   unsigned long clone_flags)
+                                   u64 clone_flags)
 {
 }
 
index bf7613ba412bfe2dae6ced334952e97cddee65cd..ba34ec0e2f95d7ecf1a93e6934a150538c02770d 100644 (file)
@@ -35,7 +35,7 @@ static inline void get_uts_ns(struct uts_namespace *ns)
        refcount_inc(&ns->ns.count);
 }
 
-extern struct uts_namespace *copy_utsname(unsigned long flags,
+extern struct uts_namespace *copy_utsname(u64 flags,
        struct user_namespace *user_ns, struct uts_namespace *old_ns);
 extern void free_uts_ns(struct uts_namespace *ns);
 
@@ -55,7 +55,7 @@ static inline void put_uts_ns(struct uts_namespace *ns)
 {
 }
 
-static inline struct uts_namespace *copy_utsname(unsigned long flags,
+static inline struct uts_namespace *copy_utsname(u64 flags,
        struct user_namespace *user_ns, struct uts_namespace *old_ns)
 {
        if (flags & CLONE_NEWUTS)
index 025a7574b275f34b7757cb64cd5dfb9a1aeb5169..0e008cfe159d6ebbb776408057a3303d4e7e9a46 100644 (file)
@@ -204,7 +204,7 @@ struct net {
 extern struct net init_net;
 
 #ifdef CONFIG_NET_NS
-struct net *copy_net_ns(unsigned long flags, struct user_namespace *user_ns,
+struct net *copy_net_ns(u64 flags, struct user_namespace *user_ns,
                        struct net *old_net);
 
 void net_ns_get_ownership(const struct net *net, kuid_t *uid, kgid_t *gid);
@@ -218,7 +218,7 @@ extern struct task_struct *cleanup_net_task;
 #else /* CONFIG_NET_NS */
 #include <linux/sched.h>
 #include <linux/nsproxy.h>
-static inline struct net *copy_net_ns(unsigned long flags,
+static inline struct net *copy_net_ns(u64 flags,
        struct user_namespace *user_ns, struct net *old_net)
 {
        if (flags & CLONE_NEWNET)
index af535b053033042bd976170b170c56e235ad58b4..4f0759634306c7a52475d153ddd3ab622e1acaec 100644 (file)
@@ -8,14 +8,14 @@
 
 TRACE_EVENT(task_newtask,
 
-       TP_PROTO(struct task_struct *task, unsigned long clone_flags),
+       TP_PROTO(struct task_struct *task, u64 clone_flags),
 
        TP_ARGS(task, clone_flags),
 
        TP_STRUCT__entry(
                __field(        pid_t,  pid)
                __array(        char,   comm, TASK_COMM_LEN)
-               __field( unsigned long, clone_flags)
+               __field(        u64,    clone_flags)
                __field(        short,  oom_score_adj)
        ),
 
@@ -26,7 +26,7 @@ TRACE_EVENT(task_newtask,
                __entry->oom_score_adj = task->signal->oom_score_adj;
        ),
 
-       TP_printk("pid=%d comm=%s clone_flags=%lx oom_score_adj=%hd",
+       TP_printk("pid=%d comm=%s clone_flags=%llx oom_score_adj=%hd",
                __entry->pid, __entry->comm,
                __entry->clone_flags, __entry->oom_score_adj)
 );
index 4df91ceeeafe9fe8851cc5ffdf55c4e8ee59b655..a712ec27209cc9099bfdbe9448b734f2535a1334 100644 (file)
@@ -106,7 +106,7 @@ fail:
        return ERR_PTR(err);
 }
 
-struct ipc_namespace *copy_ipcs(unsigned long flags,
+struct ipc_namespace *copy_ipcs(u64 flags,
        struct user_namespace *user_ns, struct ipc_namespace *ns)
 {
        if (!(flags & CLONE_NEWIPC))
index a39cdc7bf88fa25828b73429845de8258df58534..0f06e4bd4673f5ce89ca7e88a3ae04164ee5c65e 100644 (file)
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -2303,7 +2303,7 @@ SYSCALL_DEFINE3(semop, int, semid, struct sembuf __user *, tsops,
  * parent and child tasks.
  */
 
-int copy_semundo(unsigned long clone_flags, struct task_struct *tsk)
+int copy_semundo(u64 clone_flags, struct task_struct *tsk)
 {
        struct sem_undo_list *undo_list;
        int error;
index 144a464e45c66447235b3b265efcd1092f32c2a2..dedadb525880783c81f887621473012f08fb3c2a 100644 (file)
@@ -47,7 +47,7 @@ void free_cgroup_ns(struct cgroup_namespace *ns)
 }
 EXPORT_SYMBOL(free_cgroup_ns);
 
-struct cgroup_namespace *copy_cgroup_ns(unsigned long flags,
+struct cgroup_namespace *copy_cgroup_ns(u64 flags,
                                        struct user_namespace *user_ns,
                                        struct cgroup_namespace *old_ns)
 {
index 9676965c0981a01121757b2d904785c1a59e885f..dbf6b687dc5c5a25cf2eb8af933c64f26c444b3f 100644 (file)
@@ -287,7 +287,7 @@ struct cred *prepare_exec_creds(void)
  * The new process gets the current process's subjective credentials as its
  * objective and subjective credentials
  */
-int copy_creds(struct task_struct *p, unsigned long clone_flags)
+int copy_creds(struct task_struct *p, u64 clone_flags)
 {
        struct cred *new;
        int ret;
index 7ca1940607bd8340d2f4d1b74faccd40c1cfdc70..b2753014c6dd0b07996ebaac46de3dc56f45fbb6 100644 (file)
@@ -2160,7 +2160,7 @@ static void dup_xol_work(struct callback_head *work)
 /*
  * Called in context of a new clone/fork from copy_process.
  */
-void uprobe_copy_process(struct task_struct *t, unsigned long flags)
+void uprobe_copy_process(struct task_struct *t, u64 flags)
 {
        struct uprobe_task *utask = current->utask;
        struct mm_struct *mm = current->mm;
index 4e2c5a3e898911f1009d60a7171c3eb303311308..d6e1fb11eff9e69b39dd1193221edd56fcb514ff 100644 (file)
@@ -1507,7 +1507,7 @@ fail_nomem:
        return NULL;
 }
 
-static int copy_mm(unsigned long clone_flags, struct task_struct *tsk)
+static int copy_mm(u64 clone_flags, struct task_struct *tsk)
 {
        struct mm_struct *mm, *oldmm;
 
@@ -1545,7 +1545,7 @@ static int copy_mm(unsigned long clone_flags, struct task_struct *tsk)
        return 0;
 }
 
-static int copy_fs(unsigned long clone_flags, struct task_struct *tsk)
+static int copy_fs(u64 clone_flags, struct task_struct *tsk)
 {
        struct fs_struct *fs = current->fs;
        if (clone_flags & CLONE_FS) {
@@ -1566,7 +1566,7 @@ static int copy_fs(unsigned long clone_flags, struct task_struct *tsk)
        return 0;
 }
 
-static int copy_files(unsigned long clone_flags, struct task_struct *tsk,
+static int copy_files(u64 clone_flags, struct task_struct *tsk,
                      int no_files)
 {
        struct files_struct *oldf, *newf;
@@ -1645,7 +1645,7 @@ static void posix_cpu_timers_init_group(struct signal_struct *sig)
        posix_cputimers_group_init(pct, cpu_limit);
 }
 
-static int copy_signal(unsigned long clone_flags, struct task_struct *tsk)
+static int copy_signal(u64 clone_flags, struct task_struct *tsk)
 {
        struct signal_struct *sig;
 
index 5f31fdff8a38f5d932df1ed243e88497ea9b2fea..8af3b9ec3aa81a0c98d768d59f4e3767872d53de 100644 (file)
@@ -64,7 +64,7 @@ static inline struct nsproxy *create_nsproxy(void)
  * Return the newly created nsproxy.  Do not attach this to the task,
  * leave it to the caller to do proper locking and attach it to task.
  */
-static struct nsproxy *create_new_namespaces(unsigned long flags,
+static struct nsproxy *create_new_namespaces(u64 flags,
        struct task_struct *tsk, struct user_namespace *user_ns,
        struct fs_struct *new_fs)
 {
@@ -144,7 +144,7 @@ out_ns:
  * called from clone.  This now handles copy for nsproxy and all
  * namespaces therein.
  */
-int copy_namespaces(unsigned long flags, struct task_struct *tsk)
+int copy_namespaces(u64 flags, struct task_struct *tsk)
 {
        struct nsproxy *old_ns = tsk->nsproxy;
        struct user_namespace *user_ns = task_cred_xxx(tsk, user_ns);
index 7098ed44e717d3da8f518f3826cb8047bb744786..06bc7c7f78e09537d27f6e0295658bf5047fa27e 100644 (file)
@@ -171,7 +171,7 @@ static void destroy_pid_namespace_work(struct work_struct *work)
        } while (ns != &init_pid_ns && refcount_dec_and_test(&ns->ns.count));
 }
 
-struct pid_namespace *copy_pid_ns(unsigned long flags,
+struct pid_namespace *copy_pid_ns(u64 flags,
        struct user_namespace *user_ns, struct pid_namespace *old_ns)
 {
        if (!(flags & CLONE_NEWPID))
index be00629f0ba4cc5832189c0052b0b632deb4ea2e..6fa85d30d96599a393f90fffaee6a51b93edf2df 100644 (file)
@@ -4472,7 +4472,7 @@ int wake_up_state(struct task_struct *p, unsigned int state)
  * __sched_fork() is basic setup which is also used by sched_init() to
  * initialize the boot CPU's idle task.
  */
-static void __sched_fork(unsigned long clone_flags, struct task_struct *p)
+static void __sched_fork(u64 clone_flags, struct task_struct *p)
 {
        p->on_rq                        = 0;
 
@@ -4707,7 +4707,7 @@ late_initcall(sched_core_sysctl_init);
 /*
  * fork()/clone()-time setup:
  */
-int sched_fork(unsigned long clone_flags, struct task_struct *p)
+int sched_fork(u64 clone_flags, struct task_struct *p)
 {
        __sched_fork(clone_flags, p);
        /*
index b173a059315c2e076ef1d8347f8816d9c2c33937..af0866ce2dfc8ff3df72e3b17c3542be6c096fc5 100644 (file)
@@ -3542,7 +3542,7 @@ out:
        }
 }
 
-void init_numa_balancing(unsigned long clone_flags, struct task_struct *p)
+void init_numa_balancing(u64 clone_flags, struct task_struct *p)
 {
        int mm_users = 0;
        struct mm_struct *mm = p->mm;
index be9745d104f751d71787cb777c5235dce9f31aa1..f9adfc912ddc5f55cd6bce1b98ecc0b5134dbc89 100644 (file)
@@ -1935,12 +1935,12 @@ extern void sched_setnuma(struct task_struct *p, int node);
 extern int migrate_task_to(struct task_struct *p, int cpu);
 extern int migrate_swap(struct task_struct *p, struct task_struct *t,
                        int cpu, int scpu);
-extern void init_numa_balancing(unsigned long clone_flags, struct task_struct *p);
+extern void init_numa_balancing(u64 clone_flags, struct task_struct *p);
 
 #else /* !CONFIG_NUMA_BALANCING: */
 
 static inline void
-init_numa_balancing(unsigned long clone_flags, struct task_struct *p)
+init_numa_balancing(u64 clone_flags, struct task_struct *p)
 {
 }
 
index 667452768ed3b50e48e3cfb70f8ef68e4bed9e0b..888872bcc5bbfaf066e566bf20ed3f9f6d2ac869 100644 (file)
@@ -130,7 +130,7 @@ fail:
  *
  * Return: timens_for_children namespace or ERR_PTR.
  */
-struct time_namespace *copy_time_ns(unsigned long flags,
+struct time_namespace *copy_time_ns(u64 flags,
        struct user_namespace *user_ns, struct time_namespace *old_ns)
 {
        if (!(flags & CLONE_NEWTIME))
index b1ac3ca870f24e94dd867bc0cc5fc1541e7b9645..00d8d7922f860a5786cf5770c2b62ca3fa78739b 100644 (file)
@@ -86,7 +86,7 @@ fail:
  * utsname of this process won't be seen by parent, and vice
  * versa.
  */
-struct uts_namespace *copy_utsname(unsigned long flags,
+struct uts_namespace *copy_utsname(u64 flags,
        struct user_namespace *user_ns, struct uts_namespace *old_ns)
 {
        struct uts_namespace *new_ns;
index 1b6f3826dd0e1f5d5333e4dccd122afe08759e2c..8ec9d83475bf8628546ec022d7bedb4e9509adba 100644 (file)
@@ -539,7 +539,7 @@ void net_drop_ns(void *p)
                net_passive_dec(net);
 }
 
-struct net *copy_net_ns(unsigned long flags,
+struct net *copy_net_ns(u64 flags,
                        struct user_namespace *user_ns, struct net *old_net)
 {
        struct ucounts *ucounts;
index 8e1cc229b41b395487aecde6b6c2d3e43c1fcef4..ba39cfe0cd08e51c979c376a709eec6041c92e4b 100644 (file)
@@ -112,7 +112,7 @@ static void apparmor_task_free(struct task_struct *task)
 }
 
 static int apparmor_task_alloc(struct task_struct *task,
-                              unsigned long clone_flags)
+                              u64 clone_flags)
 {
        struct aa_task_ctx *new = task_ctx(task);
 
index ad163f06bf7abc4327f9918f11b903e1649ef35e..a769140553bc3c37c83db74755a606fdda11ddd6 100644 (file)
@@ -3185,7 +3185,7 @@ int security_file_truncate(struct file *file)
  *
  * Return: Returns a zero on success, negative values on failure.
  */
-int security_task_alloc(struct task_struct *task, unsigned long clone_flags)
+int security_task_alloc(struct task_struct *task, u64 clone_flags)
 {
        int rc = lsm_task_alloc(task);
 
index c95a5874bf7d405d828e20fa0d8e997c02ee213b..bb016dd511c14d7f32411450c5b3891a7f2089e8 100644 (file)
@@ -4144,7 +4144,7 @@ static int selinux_file_open(struct file *file)
 /* task security operations */
 
 static int selinux_task_alloc(struct task_struct *task,
-                             unsigned long clone_flags)
+                             u64 clone_flags)
 {
        u32 sid = current_sid();
 
index d6ebcd9db80a37b02400e60df055feb8a321bc62..48fc59d38ab217283beceabb7375642c7db3093a 100644 (file)
@@ -514,7 +514,7 @@ struct lsm_blob_sizes tomoyo_blob_sizes __ro_after_init = {
  * Returns 0.
  */
 static int tomoyo_task_alloc(struct task_struct *task,
-                            unsigned long clone_flags)
+                            u64 clone_flags)
 {
        struct tomoyo_task *old = tomoyo_task(current);
        struct tomoyo_task *new = tomoyo_task(task);