History

copy_process: pass clone_flags as u64 across calltree

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.

Simon Schuster committed 1 year ago

Commit edd3cb01 parent 04ff48238 files · +59 −59Browse files

Unified · Split

38 files
  1. block/blk-ioc.c +1 −1
  2. fs/namespace.c +1 −1
  3. include/linux/cgroup.h +2 −2
  4. include/linux/cred.h +1 −1
  5. include/linux/iocontext.h +3 −3
  6. include/linux/ipc_namespace.h +2 −2
  7. include/linux/lsm_hook_defs.h +1 −1
  8. include/linux/mnt_namespace.h +1 −1
  9. include/linux/nsproxy.h +1 −1
  10. include/linux/pid_namespace.h +2 −2
  11. include/linux/rseq.h +2 −2
  12. include/linux/sched/task.h +1 −1
  13. include/linux/security.h +2 −2
  14. include/linux/sem.h +2 −2
  15. include/linux/time_namespace.h +2 −2
  16. include/linux/uprobes.h +2 −2
  17. include/linux/user_events.h +2 −2
  18. include/linux/utsname.h +2 −2
  19. include/net/net_namespace.h +2 −2
  20. include/trace/events/task.h +3 −3
  21. ipc/namespace.c +1 −1
  22. ipc/sem.c +1 −1
  23. kernel/cgroup/namespace.c +1 −1
  24. kernel/cred.c +1 −1
  25. kernel/events/uprobes.c +1 −1
  26. kernel/fork.c +4 −4
  27. kernel/nsproxy.c +2 −2
  28. kernel/pid_namespace.c +1 −1
  29. kernel/sched/core.c +2 −2
  30. kernel/sched/fair.c +1 −1
  31. kernel/sched/sched.h +2 −2
  32. kernel/time/namespace.c +1 −1
  33. kernel/utsname.c +1 −1
  34. net/core/net_namespace.c +1 −1
  35. security/apparmor/lsm.c +1 −1
  36. security/security.c +1 −1
  37. security/selinux/hooks.c +1 −1
  38. security/tomoyo/tomoyo.c +1 −1
block/blk-ioc.c+1−1
@@ -286,7 +286,7 @@ out: · 285 unmodified lines
286}286}
287EXPORT_SYMBOL_GPL(set_task_ioprio);287EXPORT_SYMBOL_GPL(set_task_ioprio);
288 288
289int __copy_io(unsigned long clone_flags, struct task_struct *tsk)289int __copy_io(u64 clone_flags, struct task_struct *tsk)
290{290{
291 struct io_context *ioc = current->io_context;291 struct io_context *ioc = current->io_context;
292 292
fs/namespace.c+1−1
@@ -4200,7 +4200,7 @@ static struct mnt_namespace *alloc_mnt_ns(struct user_namespace *user_ns, bool a · 4199 unmodified lines
4200}4200}
4201 4201
4202__latent_entropy4202__latent_entropy
4203struct mnt_namespace *copy_mnt_ns(unsigned long flags, struct mnt_namespace *ns,4203struct mnt_namespace *copy_mnt_ns(u64 flags, struct mnt_namespace *ns,
4204 struct user_namespace *user_ns, struct fs_struct *new_fs)4204 struct user_namespace *user_ns, struct fs_struct *new_fs)
4205{4205{
4206 struct mnt_namespace *new_ns;4206 struct mnt_namespace *new_ns;
include/linux/cgroup.h+2−2
@@ -796,7 +796,7 @@ extern struct cgroup_namespace init_cgroup_ns; · 795 unmodified lines
796 796
797void free_cgroup_ns(struct cgroup_namespace *ns);797void free_cgroup_ns(struct cgroup_namespace *ns);
798 798
799struct cgroup_namespace *copy_cgroup_ns(unsigned long flags,799struct cgroup_namespace *copy_cgroup_ns(u64 flags,
800 struct user_namespace *user_ns,800 struct user_namespace *user_ns,
801 struct cgroup_namespace *old_ns);801 struct cgroup_namespace *old_ns);
802 802
@@ -818,7 +818,7 @@ static inline void put_cgroup_ns(struct cgroup_namespace *ns) · 15 unmodified lines
818 818
819static inline void free_cgroup_ns(struct cgroup_namespace *ns) { }819static inline void free_cgroup_ns(struct cgroup_namespace *ns) { }
820static inline struct cgroup_namespace *820static inline struct cgroup_namespace *
821copy_cgroup_ns(unsigned long flags, struct user_namespace *user_ns,821copy_cgroup_ns(u64 flags, struct user_namespace *user_ns,
822 struct cgroup_namespace *old_ns)822 struct cgroup_namespace *old_ns)
823{823{
824 return old_ns;824 return old_ns;
include/linux/cred.h+1−1
@@ -148,7 +148,7 @@ struct cred { · 147 unmodified lines
148 148
149extern void __put_cred(struct cred *);149extern void __put_cred(struct cred *);
150extern void exit_creds(struct task_struct *);150extern void exit_creds(struct task_struct *);
151extern int copy_creds(struct task_struct *, unsigned long);151extern int copy_creds(struct task_struct *, u64);
152extern const struct cred *get_task_cred(struct task_struct *);152extern const struct cred *get_task_cred(struct task_struct *);
153extern struct cred *cred_alloc_blank(void);153extern struct cred *cred_alloc_blank(void);
154extern struct cred *prepare_creds(void);154extern struct cred *prepare_creds(void);
include/linux/iocontext.h+3−3
@@ -118,8 +118,8 @@ struct task_struct; · 117 unmodified lines
118#ifdef CONFIG_BLOCK118#ifdef CONFIG_BLOCK
119void put_io_context(struct io_context *ioc);119void put_io_context(struct io_context *ioc);
120void exit_io_context(struct task_struct *task);120void exit_io_context(struct task_struct *task);
121int __copy_io(unsigned long clone_flags, struct task_struct *tsk);121int __copy_io(u64 clone_flags, struct task_struct *tsk);
122static inline int copy_io(unsigned long clone_flags, struct task_struct *tsk)122static inline int copy_io(u64 clone_flags, struct task_struct *tsk)
123{123{
124 if (!current->io_context)124 if (!current->io_context)
125 return 0;125 return 0;
@@ -129,7 +129,7 @@ static inline int copy_io(unsigned long clone_flags, struct task_struct *tsk) · 3 unmodified lines
129struct io_context;129struct io_context;
130static inline void put_io_context(struct io_context *ioc) { }130static inline void put_io_context(struct io_context *ioc) { }
131static inline void exit_io_context(struct task_struct *task) { }131static inline void exit_io_context(struct task_struct *task) { }
132static inline int copy_io(unsigned long clone_flags, struct task_struct *tsk)132static inline int copy_io(u64 clone_flags, struct task_struct *tsk)
133{133{
134 return 0;134 return 0;
135}135}
include/linux/ipc_namespace.h+2−2
@@ -129,7 +129,7 @@ static inline int mq_init_ns(struct ipc_namespace *ns) { return 0; } · 128 unmodified lines
129#endif129#endif
130 130
131#if defined(CONFIG_IPC_NS)131#if defined(CONFIG_IPC_NS)
132extern struct ipc_namespace *copy_ipcs(unsigned long flags,132extern struct ipc_namespace *copy_ipcs(u64 flags,
133 struct user_namespace *user_ns, struct ipc_namespace *ns);133 struct user_namespace *user_ns, struct ipc_namespace *ns);
134 134
135static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns)135static 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 · 15 unmodified lines
151 151
152extern void put_ipc_ns(struct ipc_namespace *ns);152extern void put_ipc_ns(struct ipc_namespace *ns);
153#else153#else
154static inline struct ipc_namespace *copy_ipcs(unsigned long flags,154static inline struct ipc_namespace *copy_ipcs(u64 flags,
155 struct user_namespace *user_ns, struct ipc_namespace *ns)155 struct user_namespace *user_ns, struct ipc_namespace *ns)
156{156{
157 if (flags & CLONE_NEWIPC)157 if (flags & CLONE_NEWIPC)
include/linux/lsm_hook_defs.h+1−1
@@ -211,7 +211,7 @@ LSM_HOOK(int, 0, file_open, struct file *file) · 210 unmodified lines
211LSM_HOOK(int, 0, file_post_open, struct file *file, int mask)211LSM_HOOK(int, 0, file_post_open, struct file *file, int mask)
212LSM_HOOK(int, 0, file_truncate, struct file *file)212LSM_HOOK(int, 0, file_truncate, struct file *file)
213LSM_HOOK(int, 0, task_alloc, struct task_struct *task,213LSM_HOOK(int, 0, task_alloc, struct task_struct *task,
214 unsigned long clone_flags)214 u64 clone_flags)
215LSM_HOOK(void, LSM_RET_VOID, task_free, struct task_struct *task)215LSM_HOOK(void, LSM_RET_VOID, task_free, struct task_struct *task)
216LSM_HOOK(int, 0, cred_alloc_blank, struct cred *cred, gfp_t gfp)216LSM_HOOK(int, 0, cred_alloc_blank, struct cred *cred, gfp_t gfp)
217LSM_HOOK(void, LSM_RET_VOID, cred_free, struct cred *cred)217LSM_HOOK(void, LSM_RET_VOID, cred_free, struct cred *cred)
include/linux/mnt_namespace.h+1−1
@@ -11,7 +11,7 @@ struct fs_struct; · 10 unmodified lines
11struct user_namespace;11struct user_namespace;
12struct ns_common;12struct ns_common;
13 13
14extern struct mnt_namespace *copy_mnt_ns(unsigned long, struct mnt_namespace *,14extern struct mnt_namespace *copy_mnt_ns(u64, struct mnt_namespace *,
15 struct user_namespace *, struct fs_struct *);15 struct user_namespace *, struct fs_struct *);
16extern void put_mnt_ns(struct mnt_namespace *ns);16extern void put_mnt_ns(struct mnt_namespace *ns);
17DEFINE_FREE(put_mnt_ns, struct mnt_namespace *, if (!IS_ERR_OR_NULL(_T)) put_mnt_ns(_T))17DEFINE_FREE(put_mnt_ns, struct mnt_namespace *, if (!IS_ERR_OR_NULL(_T)) put_mnt_ns(_T))
include/linux/nsproxy.h+1−1
@@ -103,7 +103,7 @@ static inline struct cred *nsset_cred(struct nsset *set) · 102 unmodified lines
103 *103 *
104 */104 */
105 105
106int copy_namespaces(unsigned long flags, struct task_struct *tsk);106int copy_namespaces(u64 flags, struct task_struct *tsk);
107void exit_task_namespaces(struct task_struct *tsk);107void exit_task_namespaces(struct task_struct *tsk);
108void switch_task_namespaces(struct task_struct *tsk, struct nsproxy *new);108void switch_task_namespaces(struct task_struct *tsk, struct nsproxy *new);
109int exec_task_namespaces(void);109int exec_task_namespaces(void);
include/linux/pid_namespace.h+2−2
@@ -78,7 +78,7 @@ static inline int pidns_memfd_noexec_scope(struct pid_namespace *ns) · 77 unmodified lines
78}78}
79#endif79#endif
80 80
81extern struct pid_namespace *copy_pid_ns(unsigned long flags,81extern struct pid_namespace *copy_pid_ns(u64 flags,
82 struct user_namespace *user_ns, struct pid_namespace *ns);82 struct user_namespace *user_ns, struct pid_namespace *ns);
83extern void zap_pid_ns_processes(struct pid_namespace *pid_ns);83extern void zap_pid_ns_processes(struct pid_namespace *pid_ns);
84extern int reboot_pid_ns(struct pid_namespace *pid_ns, int cmd);84extern 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) · 12 unmodified lines
97 return 0;97 return 0;
98}98}
99 99
100static inline struct pid_namespace *copy_pid_ns(unsigned long flags,100static inline struct pid_namespace *copy_pid_ns(u64 flags,
101 struct user_namespace *user_ns, struct pid_namespace *ns)101 struct user_namespace *user_ns, struct pid_namespace *ns)
102{102{
103 if (flags & CLONE_NEWPID)103 if (flags & CLONE_NEWPID)
include/linux/rseq.h+2−2
@@ -65,7 +65,7 @@ static inline void rseq_migrate(struct task_struct *t) · 64 unmodified lines
65 * If parent process has a registered restartable sequences area, the65 * If parent process has a registered restartable sequences area, the
66 * child inherits. Unregister rseq for a clone with CLONE_VM set.66 * child inherits. Unregister rseq for a clone with CLONE_VM set.
67 */67 */
68static inline void rseq_fork(struct task_struct *t, unsigned long clone_flags)68static inline void rseq_fork(struct task_struct *t, u64 clone_flags)
69{69{
70 if (clone_flags & CLONE_VM) {70 if (clone_flags & CLONE_VM) {
71 t->rseq = NULL;71 t->rseq = NULL;
@@ -107,7 +107,7 @@ static inline void rseq_preempt(struct task_struct *t) · 35 unmodified lines
107static inline void rseq_migrate(struct task_struct *t)107static inline void rseq_migrate(struct task_struct *t)
108{108{
109}109}
110static inline void rseq_fork(struct task_struct *t, unsigned long clone_flags)110static inline void rseq_fork(struct task_struct *t, u64 clone_flags)
111{111{
112}112}
113static inline void rseq_execve(struct task_struct *t)113static inline void rseq_execve(struct task_struct *t)
include/linux/sched/task.h+1−1
@@ -63,7 +63,7 @@ extern int lockdep_tasklist_lock_is_held(void); · 62 unmodified lines
63extern asmlinkage void schedule_tail(struct task_struct *prev);63extern asmlinkage void schedule_tail(struct task_struct *prev);
64extern void init_idle(struct task_struct *idle, int cpu);64extern void init_idle(struct task_struct *idle, int cpu);
65 65
66extern int sched_fork(unsigned long clone_flags, struct task_struct *p);66extern int sched_fork(u64 clone_flags, struct task_struct *p);
67extern int sched_cgroup_fork(struct task_struct *p, struct kernel_clone_args *kargs);67extern int sched_cgroup_fork(struct task_struct *p, struct kernel_clone_args *kargs);
68extern void sched_cancel_fork(struct task_struct *p);68extern void sched_cancel_fork(struct task_struct *p);
69extern void sched_post_fork(struct task_struct *p);69extern void sched_post_fork(struct task_struct *p);
include/linux/security.h+2−2
@@ -489,7 +489,7 @@ int security_file_receive(struct file *file); · 488 unmodified lines
489int security_file_open(struct file *file);489int security_file_open(struct file *file);
490int security_file_post_open(struct file *file, int mask);490int security_file_post_open(struct file *file, int mask);
491int security_file_truncate(struct file *file);491int security_file_truncate(struct file *file);
492int security_task_alloc(struct task_struct *task, unsigned long clone_flags);492int security_task_alloc(struct task_struct *task, u64 clone_flags);
493void security_task_free(struct task_struct *task);493void security_task_free(struct task_struct *task);
494int security_cred_alloc_blank(struct cred *cred, gfp_t gfp);494int security_cred_alloc_blank(struct cred *cred, gfp_t gfp);
495void security_cred_free(struct cred *cred);495void security_cred_free(struct cred *cred);
@@ -1215,7 +1215,7 @@ static inline int security_file_truncate(struct file *file) · 719 unmodified lines
1215}1215}
1216 1216
1217static inline int security_task_alloc(struct task_struct *task,1217static inline int security_task_alloc(struct task_struct *task,
1218 unsigned long clone_flags)1218 u64 clone_flags)
1219{1219{
1220 return 0;1220 return 0;
1221}1221}
include/linux/sem.h+2−2
@@ -9,12 +9,12 @@ struct task_struct; · 8 unmodified lines
9 9
10#ifdef CONFIG_SYSVIPC10#ifdef CONFIG_SYSVIPC
11 11
12extern int copy_semundo(unsigned long clone_flags, struct task_struct *tsk);12extern int copy_semundo(u64 clone_flags, struct task_struct *tsk);
13extern void exit_sem(struct task_struct *tsk);13extern void exit_sem(struct task_struct *tsk);
14 14
15#else15#else
16 16
17static inline int copy_semundo(unsigned long clone_flags, struct task_struct *tsk)17static inline int copy_semundo(u64 clone_flags, struct task_struct *tsk)
18{18{
19 return 0;19 return 0;
20}20}
include/linux/time_namespace.h+2−2
@@ -43,7 +43,7 @@ static inline struct time_namespace *get_time_ns(struct time_namespace *ns) · 42 unmodified lines
43 return ns;43 return ns;
44}44}
45 45
46struct time_namespace *copy_time_ns(unsigned long flags,46struct time_namespace *copy_time_ns(u64 flags,
47 struct user_namespace *user_ns,47 struct user_namespace *user_ns,
48 struct time_namespace *old_ns);48 struct time_namespace *old_ns);
49void free_time_ns(struct time_namespace *ns);49void free_time_ns(struct time_namespace *ns);
@@ -129,7 +129,7 @@ static inline void put_time_ns(struct time_namespace *ns) · 79 unmodified lines
129}129}
130 130
131static inline131static inline
132struct time_namespace *copy_time_ns(unsigned long flags,132struct time_namespace *copy_time_ns(u64 flags,
133 struct user_namespace *user_ns,133 struct user_namespace *user_ns,
134 struct time_namespace *old_ns)134 struct time_namespace *old_ns)
135{135{
include/linux/uprobes.h+2−2
@@ -205,7 +205,7 @@ extern void uprobe_start_dup_mmap(void); · 204 unmodified lines
205extern void uprobe_end_dup_mmap(void);205extern void uprobe_end_dup_mmap(void);
206extern void uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm);206extern void uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm);
207extern void uprobe_free_utask(struct task_struct *t);207extern void uprobe_free_utask(struct task_struct *t);
208extern void uprobe_copy_process(struct task_struct *t, unsigned long flags);208extern void uprobe_copy_process(struct task_struct *t, u64 flags);
209extern int uprobe_post_sstep_notifier(struct pt_regs *regs);209extern int uprobe_post_sstep_notifier(struct pt_regs *regs);
210extern int uprobe_pre_sstep_notifier(struct pt_regs *regs);210extern int uprobe_pre_sstep_notifier(struct pt_regs *regs);
211extern void uprobe_notify_resume(struct pt_regs *regs);211extern void uprobe_notify_resume(struct pt_regs *regs);
@@ -281,7 +281,7 @@ static inline bool uprobe_deny_signal(void) · 69 unmodified lines
281static inline void uprobe_free_utask(struct task_struct *t)281static inline void uprobe_free_utask(struct task_struct *t)
282{282{
283}283}
284static inline void uprobe_copy_process(struct task_struct *t, unsigned long flags)284static inline void uprobe_copy_process(struct task_struct *t, u64 flags)
285{285{
286}286}
287static inline void uprobe_clear_state(struct mm_struct *mm)287static inline void uprobe_clear_state(struct mm_struct *mm)
include/linux/user_events.h+2−2
@@ -33,7 +33,7 @@ extern void user_event_mm_dup(struct task_struct *t, · 32 unmodified lines
33extern void user_event_mm_remove(struct task_struct *t);33extern void user_event_mm_remove(struct task_struct *t);
34 34
35static inline void user_events_fork(struct task_struct *t,35static inline void user_events_fork(struct task_struct *t,
36 unsigned long clone_flags)36 u64 clone_flags)
37{37{
38 struct user_event_mm *old_mm;38 struct user_event_mm *old_mm;
39 39
@@ -68,7 +68,7 @@ static inline void user_events_exit(struct task_struct *t) · 28 unmodified lines
68}68}
69#else69#else
70static inline void user_events_fork(struct task_struct *t,70static inline void user_events_fork(struct task_struct *t,
71 unsigned long clone_flags)71 u64 clone_flags)
72{72{
73}73}
74 74
include/linux/utsname.h+2−2
@@ -35,7 +35,7 @@ static inline void get_uts_ns(struct uts_namespace *ns) · 34 unmodified lines
35 refcount_inc(&ns->ns.count);35 refcount_inc(&ns->ns.count);
36}36}
37 37
38extern struct uts_namespace *copy_utsname(unsigned long flags,38extern struct uts_namespace *copy_utsname(u64 flags,
39 struct user_namespace *user_ns, struct uts_namespace *old_ns);39 struct user_namespace *user_ns, struct uts_namespace *old_ns);
40extern void free_uts_ns(struct uts_namespace *ns);40extern void free_uts_ns(struct uts_namespace *ns);
41 41
@@ -55,7 +55,7 @@ static inline void put_uts_ns(struct uts_namespace *ns) · 13 unmodified lines
55{55{
56}56}
57 57
58static inline struct uts_namespace *copy_utsname(unsigned long flags,58static inline struct uts_namespace *copy_utsname(u64 flags,
59 struct user_namespace *user_ns, struct uts_namespace *old_ns)59 struct user_namespace *user_ns, struct uts_namespace *old_ns)
60{60{
61 if (flags & CLONE_NEWUTS)61 if (flags & CLONE_NEWUTS)
include/net/net_namespace.h+2−2
@@ -204,7 +204,7 @@ struct net { · 203 unmodified lines
204extern struct net init_net;204extern struct net init_net;
205 205
206#ifdef CONFIG_NET_NS206#ifdef CONFIG_NET_NS
207struct net *copy_net_ns(unsigned long flags, struct user_namespace *user_ns,207struct net *copy_net_ns(u64 flags, struct user_namespace *user_ns,
208 struct net *old_net);208 struct net *old_net);
209 209
210void net_ns_get_ownership(const struct net *net, kuid_t *uid, kgid_t *gid);210void 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; · 7 unmodified lines
218#else /* CONFIG_NET_NS */218#else /* CONFIG_NET_NS */
219#include <linux/sched.h>219#include <linux/sched.h>
220#include <linux/nsproxy.h>220#include <linux/nsproxy.h>
221static inline struct net *copy_net_ns(unsigned long flags,221static inline struct net *copy_net_ns(u64 flags,
222 struct user_namespace *user_ns, struct net *old_net)222 struct user_namespace *user_ns, struct net *old_net)
223{223{
224 if (flags & CLONE_NEWNET)224 if (flags & CLONE_NEWNET)
include/trace/events/task.h+3−3
@@ -8,14 +8,14 @@ · 7 unmodified lines
8 8
9TRACE_EVENT(task_newtask,9TRACE_EVENT(task_newtask,
10 10
11 TP_PROTO(struct task_struct *task, unsigned long clone_flags),11 TP_PROTO(struct task_struct *task, u64 clone_flags),
12 12
13 TP_ARGS(task, clone_flags),13 TP_ARGS(task, clone_flags),
14 14
15 TP_STRUCT__entry(15 TP_STRUCT__entry(
16 __field( pid_t, pid)16 __field( pid_t, pid)
17 __array( char, comm, TASK_COMM_LEN)17 __array( char, comm, TASK_COMM_LEN)
18 __field( unsigned long, clone_flags)18 __field( u64, clone_flags)
19 __field( short, oom_score_adj)19 __field( short, oom_score_adj)
20 ),20 ),
21 21
@@ -26,7 +26,7 @@ TRACE_EVENT(task_newtask, · 4 unmodified lines
26 __entry->oom_score_adj = task->signal->oom_score_adj;26 __entry->oom_score_adj = task->signal->oom_score_adj;
27 ),27 ),
28 28
29 TP_printk("pid=%d comm=%s clone_flags=%lx oom_score_adj=%hd",29 TP_printk("pid=%d comm=%s clone_flags=%llx oom_score_adj=%hd",
30 __entry->pid, __entry->comm,30 __entry->pid, __entry->comm,
31 __entry->clone_flags, __entry->oom_score_adj)31 __entry->clone_flags, __entry->oom_score_adj)
32);32);
ipc/namespace.c+1−1
@@ -106,7 +106,7 @@ fail: · 105 unmodified lines
106 return ERR_PTR(err);106 return ERR_PTR(err);
107}107}
108 108
109struct ipc_namespace *copy_ipcs(unsigned long flags,109struct ipc_namespace *copy_ipcs(u64 flags,
110 struct user_namespace *user_ns, struct ipc_namespace *ns)110 struct user_namespace *user_ns, struct ipc_namespace *ns)
111{111{
112 if (!(flags & CLONE_NEWIPC))112 if (!(flags & CLONE_NEWIPC))
ipc/sem.c+1−1
@@ -2303,7 +2303,7 @@ SYSCALL_DEFINE3(semop, int, semid, struct sembuf __user *, tsops, · 2302 unmodified lines
2303 * parent and child tasks.2303 * parent and child tasks.
2304 */2304 */
2305 2305
2306int copy_semundo(unsigned long clone_flags, struct task_struct *tsk)2306int copy_semundo(u64 clone_flags, struct task_struct *tsk)
2307{2307{
2308 struct sem_undo_list *undo_list;2308 struct sem_undo_list *undo_list;
2309 int error;2309 int error;
kernel/cgroup/namespace.c+1−1
@@ -47,7 +47,7 @@ void free_cgroup_ns(struct cgroup_namespace *ns) · 46 unmodified lines
47}47}
48EXPORT_SYMBOL(free_cgroup_ns);48EXPORT_SYMBOL(free_cgroup_ns);
49 49
50struct cgroup_namespace *copy_cgroup_ns(unsigned long flags,50struct cgroup_namespace *copy_cgroup_ns(u64 flags,
51 struct user_namespace *user_ns,51 struct user_namespace *user_ns,
52 struct cgroup_namespace *old_ns)52 struct cgroup_namespace *old_ns)
53{53{
kernel/cred.c+1−1
@@ -287,7 +287,7 @@ struct cred *prepare_exec_creds(void) · 286 unmodified lines
287 * The new process gets the current process's subjective credentials as its287 * The new process gets the current process's subjective credentials as its
288 * objective and subjective credentials288 * objective and subjective credentials
289 */289 */
290int copy_creds(struct task_struct *p, unsigned long clone_flags)290int copy_creds(struct task_struct *p, u64 clone_flags)
291{291{
292 struct cred *new;292 struct cred *new;
293 int ret;293 int ret;
kernel/events/uprobes.c+1−1
@@ -2160,7 +2160,7 @@ static void dup_xol_work(struct callback_head *work) · 2159 unmodified lines
2160/*2160/*
2161 * Called in context of a new clone/fork from copy_process.2161 * Called in context of a new clone/fork from copy_process.
2162 */2162 */
2163void uprobe_copy_process(struct task_struct *t, unsigned long flags)2163void uprobe_copy_process(struct task_struct *t, u64 flags)
2164{2164{
2165 struct uprobe_task *utask = current->utask;2165 struct uprobe_task *utask = current->utask;
2166 struct mm_struct *mm = current->mm;2166 struct mm_struct *mm = current->mm;
kernel/fork.c+4−4
@@ -1507,7 +1507,7 @@ fail_nomem: · 1506 unmodified lines
1507 return NULL;1507 return NULL;
1508}1508}
1509 1509
1510static int copy_mm(unsigned long clone_flags, struct task_struct *tsk)1510static int copy_mm(u64 clone_flags, struct task_struct *tsk)
1511{1511{
1512 struct mm_struct *mm, *oldmm;1512 struct mm_struct *mm, *oldmm;
1513 1513
@@ -1545,7 +1545,7 @@ static int copy_mm(unsigned long clone_flags, struct task_struct *tsk) · 31 unmodified lines
1545 return 0;1545 return 0;
1546}1546}
1547 1547
1548static int copy_fs(unsigned long clone_flags, struct task_struct *tsk)1548static int copy_fs(u64 clone_flags, struct task_struct *tsk)
1549{1549{
1550 struct fs_struct *fs = current->fs;1550 struct fs_struct *fs = current->fs;
1551 if (clone_flags & CLONE_FS) {1551 if (clone_flags & CLONE_FS) {
@@ -1566,7 +1566,7 @@ static int copy_fs(unsigned long clone_flags, struct task_struct *tsk) · 14 unmodified lines
1566 return 0;1566 return 0;
1567}1567}
1568 1568
1569static int copy_files(unsigned long clone_flags, struct task_struct *tsk,1569static int copy_files(u64 clone_flags, struct task_struct *tsk,
1570 int no_files)1570 int no_files)
1571{1571{
1572 struct files_struct *oldf, *newf;1572 struct files_struct *oldf, *newf;
@@ -1645,7 +1645,7 @@ static void posix_cpu_timers_init_group(struct signal_struct *sig) · 72 unmodified lines
1645 posix_cputimers_group_init(pct, cpu_limit);1645 posix_cputimers_group_init(pct, cpu_limit);
1646}1646}
1647 1647
1648static int copy_signal(unsigned long clone_flags, struct task_struct *tsk)1648static int copy_signal(u64 clone_flags, struct task_struct *tsk)
1649{1649{
1650 struct signal_struct *sig;1650 struct signal_struct *sig;
1651 1651
kernel/nsproxy.c+2−2
@@ -64,7 +64,7 @@ static inline struct nsproxy *create_nsproxy(void) · 63 unmodified lines
64 * Return the newly created nsproxy. Do not attach this to the task,64 * Return the newly created nsproxy. Do not attach this to the task,
65 * leave it to the caller to do proper locking and attach it to task.65 * leave it to the caller to do proper locking and attach it to task.
66 */66 */
67static struct nsproxy *create_new_namespaces(unsigned long flags,67static struct nsproxy *create_new_namespaces(u64 flags,
68 struct task_struct *tsk, struct user_namespace *user_ns,68 struct task_struct *tsk, struct user_namespace *user_ns,
69 struct fs_struct *new_fs)69 struct fs_struct *new_fs)
70{70{
@@ -144,7 +144,7 @@ out_ns: · 73 unmodified lines
144 * called from clone. This now handles copy for nsproxy and all144 * called from clone. This now handles copy for nsproxy and all
145 * namespaces therein.145 * namespaces therein.
146 */146 */
147int copy_namespaces(unsigned long flags, struct task_struct *tsk)147int copy_namespaces(u64 flags, struct task_struct *tsk)
148{148{
149 struct nsproxy *old_ns = tsk->nsproxy;149 struct nsproxy *old_ns = tsk->nsproxy;
150 struct user_namespace *user_ns = task_cred_xxx(tsk, user_ns);150 struct user_namespace *user_ns = task_cred_xxx(tsk, user_ns);
kernel/pid_namespace.c+1−1
@@ -171,7 +171,7 @@ static void destroy_pid_namespace_work(struct work_struct *work) · 170 unmodified lines
171 } while (ns != &init_pid_ns && refcount_dec_and_test(&ns->ns.count));171 } while (ns != &init_pid_ns && refcount_dec_and_test(&ns->ns.count));
172}172}
173 173
174struct pid_namespace *copy_pid_ns(unsigned long flags,174struct pid_namespace *copy_pid_ns(u64 flags,
175 struct user_namespace *user_ns, struct pid_namespace *old_ns)175 struct user_namespace *user_ns, struct pid_namespace *old_ns)
176{176{
177 if (!(flags & CLONE_NEWPID))177 if (!(flags & CLONE_NEWPID))
kernel/sched/core.c+2−2
@@ -4472,7 +4472,7 @@ int wake_up_state(struct task_struct *p, unsigned int state) · 4471 unmodified lines
4472 * __sched_fork() is basic setup which is also used by sched_init() to4472 * __sched_fork() is basic setup which is also used by sched_init() to
4473 * initialize the boot CPU's idle task.4473 * initialize the boot CPU's idle task.
4474 */4474 */
4475static void __sched_fork(unsigned long clone_flags, struct task_struct *p)4475static void __sched_fork(u64 clone_flags, struct task_struct *p)
4476{4476{
4477 p->on_rq = 0;4477 p->on_rq = 0;
4478 4478
@@ -4707,7 +4707,7 @@ late_initcall(sched_core_sysctl_init); · 228 unmodified lines
4707/*4707/*
4708 * fork()/clone()-time setup:4708 * fork()/clone()-time setup:
4709 */4709 */
4710int sched_fork(unsigned long clone_flags, struct task_struct *p)4710int sched_fork(u64 clone_flags, struct task_struct *p)
4711{4711{
4712 __sched_fork(clone_flags, p);4712 __sched_fork(clone_flags, p);
4713 /*4713 /*
kernel/sched/fair.c+1−1
@@ -3542,7 +3542,7 @@ out: · 3541 unmodified lines
3542 }3542 }
3543}3543}
3544 3544
3545void init_numa_balancing(unsigned long clone_flags, struct task_struct *p)3545void init_numa_balancing(u64 clone_flags, struct task_struct *p)
3546{3546{
3547 int mm_users = 0;3547 int mm_users = 0;
3548 struct mm_struct *mm = p->mm;3548 struct mm_struct *mm = p->mm;
kernel/sched/sched.h+2−2
@@ -1935,12 +1935,12 @@ extern void sched_setnuma(struct task_struct *p, int node); · 1934 unmodified lines
1935extern int migrate_task_to(struct task_struct *p, int cpu);1935extern int migrate_task_to(struct task_struct *p, int cpu);
1936extern int migrate_swap(struct task_struct *p, struct task_struct *t,1936extern int migrate_swap(struct task_struct *p, struct task_struct *t,
1937 int cpu, int scpu);1937 int cpu, int scpu);
1938extern void init_numa_balancing(unsigned long clone_flags, struct task_struct *p);1938extern void init_numa_balancing(u64 clone_flags, struct task_struct *p);
1939 1939
1940#else /* !CONFIG_NUMA_BALANCING: */1940#else /* !CONFIG_NUMA_BALANCING: */
1941 1941
1942static inline void1942static inline void
1943init_numa_balancing(unsigned long clone_flags, struct task_struct *p)1943init_numa_balancing(u64 clone_flags, struct task_struct *p)
1944{1944{
1945}1945}
1946 1946
kernel/time/namespace.c+1−1
@@ -130,7 +130,7 @@ fail: · 129 unmodified lines
130 *130 *
131 * Return: timens_for_children namespace or ERR_PTR.131 * Return: timens_for_children namespace or ERR_PTR.
132 */132 */
133struct time_namespace *copy_time_ns(unsigned long flags,133struct time_namespace *copy_time_ns(u64 flags,
134 struct user_namespace *user_ns, struct time_namespace *old_ns)134 struct user_namespace *user_ns, struct time_namespace *old_ns)
135{135{
136 if (!(flags & CLONE_NEWTIME))136 if (!(flags & CLONE_NEWTIME))
kernel/utsname.c+1−1
@@ -86,7 +86,7 @@ fail: · 85 unmodified lines
86 * utsname of this process won't be seen by parent, and vice86 * utsname of this process won't be seen by parent, and vice
87 * versa.87 * versa.
88 */88 */
89struct uts_namespace *copy_utsname(unsigned long flags,89struct uts_namespace *copy_utsname(u64 flags,
90 struct user_namespace *user_ns, struct uts_namespace *old_ns)90 struct user_namespace *user_ns, struct uts_namespace *old_ns)
91{91{
92 struct uts_namespace *new_ns;92 struct uts_namespace *new_ns;
net/core/net_namespace.c+1−1
@@ -539,7 +539,7 @@ void net_drop_ns(void *p) · 538 unmodified lines
539 net_passive_dec(net);539 net_passive_dec(net);
540}540}
541 541
542struct net *copy_net_ns(unsigned long flags,542struct net *copy_net_ns(u64 flags,
543 struct user_namespace *user_ns, struct net *old_net)543 struct user_namespace *user_ns, struct net *old_net)
544{544{
545 struct ucounts *ucounts;545 struct ucounts *ucounts;
security/apparmor/lsm.c+1−1
@@ -112,7 +112,7 @@ static void apparmor_task_free(struct task_struct *task) · 111 unmodified lines
112}112}
113 113
114static int apparmor_task_alloc(struct task_struct *task,114static int apparmor_task_alloc(struct task_struct *task,
115 unsigned long clone_flags)115 u64 clone_flags)
116{116{
117 struct aa_task_ctx *new = task_ctx(task);117 struct aa_task_ctx *new = task_ctx(task);
118 118
security/security.c+1−1
@@ -3185,7 +3185,7 @@ int security_file_truncate(struct file *file) · 3184 unmodified lines
3185 *3185 *
3186 * Return: Returns a zero on success, negative values on failure.3186 * Return: Returns a zero on success, negative values on failure.
3187 */3187 */
3188int security_task_alloc(struct task_struct *task, unsigned long clone_flags)3188int security_task_alloc(struct task_struct *task, u64 clone_flags)
3189{3189{
3190 int rc = lsm_task_alloc(task);3190 int rc = lsm_task_alloc(task);
3191 3191
security/selinux/hooks.c+1−1
@@ -4144,7 +4144,7 @@ static int selinux_file_open(struct file *file) · 4143 unmodified lines
4144/* task security operations */4144/* task security operations */
4145 4145
4146static int selinux_task_alloc(struct task_struct *task,4146static int selinux_task_alloc(struct task_struct *task,
4147 unsigned long clone_flags)4147 u64 clone_flags)
4148{4148{
4149 u32 sid = current_sid();4149 u32 sid = current_sid();
4150 4150
security/tomoyo/tomoyo.c+1−1
@@ -514,7 +514,7 @@ struct lsm_blob_sizes tomoyo_blob_sizes __ro_after_init = { · 513 unmodified lines
514 * Returns 0.514 * Returns 0.
515 */515 */
516static int tomoyo_task_alloc(struct task_struct *task,516static int tomoyo_task_alloc(struct task_struct *task,
517 unsigned long clone_flags)517 u64 clone_flags)
518{518{
519 struct tomoyo_task *old = tomoyo_task(current);519 struct tomoyo_task *old = tomoyo_task(current);
520 struct tomoyo_task *new = tomoyo_task(task);520 struct tomoyo_task *new = tomoyo_task(task);