.. | .. |
---|
10 | 10 | #include <linux/fs.h> |
---|
11 | 11 | #include <linux/mm.h> |
---|
12 | 12 | #include <linux/audit.h> |
---|
| 13 | +#include <linux/numa.h> |
---|
13 | 14 | #include <linux/scs.h> |
---|
14 | 15 | |
---|
15 | | -#include <asm/pgtable.h> |
---|
16 | 16 | #include <linux/uaccess.h> |
---|
17 | 17 | |
---|
18 | 18 | static struct signal_struct init_signals = { |
---|
.. | .. |
---|
26 | 26 | .multiprocess = HLIST_HEAD_INIT, |
---|
27 | 27 | .rlim = INIT_RLIMITS, |
---|
28 | 28 | .cred_guard_mutex = __MUTEX_INITIALIZER(init_signals.cred_guard_mutex), |
---|
| 29 | + .exec_update_lock = __RWSEM_INITIALIZER(init_signals.exec_update_lock), |
---|
29 | 30 | #ifdef CONFIG_POSIX_TIMERS |
---|
30 | 31 | .posix_timers = LIST_HEAD_INIT(init_signals.posix_timers), |
---|
31 | 32 | .cputimer = { |
---|
32 | 33 | .cputime_atomic = INIT_CPUTIME_ATOMIC, |
---|
33 | | - .running = false, |
---|
34 | | - .checking_timer = false, |
---|
35 | 34 | }, |
---|
36 | 35 | #endif |
---|
37 | 36 | INIT_CPU_TIMERS(init_signals) |
---|
.. | .. |
---|
45 | 44 | }; |
---|
46 | 45 | |
---|
47 | 46 | static struct sighand_struct init_sighand = { |
---|
48 | | - .count = ATOMIC_INIT(1), |
---|
| 47 | + .count = REFCOUNT_INIT(1), |
---|
49 | 48 | .action = { { { .sa_handler = SIG_DFL, } }, }, |
---|
50 | 49 | .siglock = __SPIN_LOCK_UNLOCKED(init_sighand.siglock), |
---|
51 | 50 | .signalfd_wqh = __WAIT_QUEUE_HEAD_INITIALIZER(init_sighand.signalfd_wqh), |
---|
52 | 51 | }; |
---|
| 52 | + |
---|
| 53 | +#ifdef CONFIG_SHADOW_CALL_STACK |
---|
| 54 | +unsigned long init_shadow_call_stack[SCS_SIZE / sizeof(long)] |
---|
| 55 | + __init_task_data = { |
---|
| 56 | + [(SCS_SIZE / sizeof(long)) - 1] = SCS_END_MAGIC |
---|
| 57 | +}; |
---|
| 58 | +#endif |
---|
53 | 59 | |
---|
54 | 60 | /* |
---|
55 | 61 | * Set up the first task table, touch at your own risk!. Base=0, |
---|
.. | .. |
---|
59 | 65 | #ifdef CONFIG_ARCH_TASK_STRUCT_ON_STACK |
---|
60 | 66 | __init_task_data |
---|
61 | 67 | #endif |
---|
| 68 | + __aligned(L1_CACHE_BYTES) |
---|
62 | 69 | = { |
---|
63 | 70 | #ifdef CONFIG_THREAD_INFO_IN_TASK |
---|
64 | 71 | .thread_info = INIT_THREAD_INFO(init_task), |
---|
65 | | - .stack_refcount = ATOMIC_INIT(1), |
---|
| 72 | + .stack_refcount = REFCOUNT_INIT(1), |
---|
66 | 73 | #endif |
---|
67 | 74 | .state = 0, |
---|
68 | 75 | .stack = init_stack, |
---|
69 | | - .usage = ATOMIC_INIT(2), |
---|
| 76 | + .usage = REFCOUNT_INIT(2), |
---|
70 | 77 | .flags = PF_KTHREAD, |
---|
71 | 78 | .prio = MAX_PRIO - 20, |
---|
72 | 79 | .static_prio = MAX_PRIO - 20, |
---|
73 | 80 | .normal_prio = MAX_PRIO - 20, |
---|
74 | 81 | .policy = SCHED_NORMAL, |
---|
75 | | - .cpus_allowed = CPU_MASK_ALL, |
---|
| 82 | + .cpus_ptr = &init_task.cpus_mask, |
---|
| 83 | + .cpus_mask = CPU_MASK_ALL, |
---|
76 | 84 | .nr_cpus_allowed= NR_CPUS, |
---|
77 | | - .cpus_requested = CPU_MASK_ALL, |
---|
78 | 85 | .mm = NULL, |
---|
79 | 86 | .active_mm = &init_mm, |
---|
80 | 87 | .restart_block = { |
---|
.. | .. |
---|
107 | 114 | .thread = INIT_THREAD, |
---|
108 | 115 | .fs = &init_fs, |
---|
109 | 116 | .files = &init_files, |
---|
| 117 | +#ifdef CONFIG_IO_URING |
---|
| 118 | + .io_uring = NULL, |
---|
| 119 | +#endif |
---|
110 | 120 | .signal = &init_signals, |
---|
111 | 121 | .sighand = &init_sighand, |
---|
112 | 122 | .nsproxy = &init_nsproxy, |
---|
.. | .. |
---|
123 | 133 | .thread_pid = &init_struct_pid, |
---|
124 | 134 | .thread_group = LIST_HEAD_INIT(init_task.thread_group), |
---|
125 | 135 | .thread_node = LIST_HEAD_INIT(init_signals.thread_head), |
---|
126 | | -#ifdef CONFIG_AUDITSYSCALL |
---|
| 136 | +#ifdef CONFIG_AUDIT |
---|
127 | 137 | .loginuid = INVALID_UID, |
---|
128 | 138 | .sessionid = AUDIT_SID_UNSET, |
---|
129 | 139 | #endif |
---|
.. | .. |
---|
142 | 152 | .rcu_tasks_holdout_list = LIST_HEAD_INIT(init_task.rcu_tasks_holdout_list), |
---|
143 | 153 | .rcu_tasks_idle_cpu = -1, |
---|
144 | 154 | #endif |
---|
| 155 | +#ifdef CONFIG_TASKS_TRACE_RCU |
---|
| 156 | + .trc_reader_nesting = 0, |
---|
| 157 | + .trc_reader_special.s = 0, |
---|
| 158 | + .trc_holdout_list = LIST_HEAD_INIT(init_task.trc_holdout_list), |
---|
| 159 | +#endif |
---|
145 | 160 | #ifdef CONFIG_CPUSETS |
---|
146 | | - .mems_allowed_seq = SEQCNT_ZERO(init_task.mems_allowed_seq), |
---|
| 161 | + .mems_allowed_seq = SEQCNT_SPINLOCK_ZERO(init_task.mems_allowed_seq, |
---|
| 162 | + &init_task.alloc_lock), |
---|
147 | 163 | #endif |
---|
148 | 164 | #ifdef CONFIG_RT_MUTEXES |
---|
149 | 165 | .pi_waiters = RB_ROOT_CACHED, |
---|
.. | .. |
---|
156 | 172 | .vtime.state = VTIME_SYS, |
---|
157 | 173 | #endif |
---|
158 | 174 | #ifdef CONFIG_NUMA_BALANCING |
---|
159 | | - .numa_preferred_nid = -1, |
---|
| 175 | + .numa_preferred_nid = NUMA_NO_NODE, |
---|
160 | 176 | .numa_group = NULL, |
---|
161 | 177 | .numa_faults = NULL, |
---|
162 | 178 | #endif |
---|
163 | | -#ifdef CONFIG_KASAN |
---|
| 179 | +#if defined(CONFIG_KASAN_GENERIC) || defined(CONFIG_KASAN_SW_TAGS) |
---|
164 | 180 | .kasan_depth = 1, |
---|
| 181 | +#endif |
---|
| 182 | +#ifdef CONFIG_KCSAN |
---|
| 183 | + .kcsan_ctx = { |
---|
| 184 | + .disable_count = 0, |
---|
| 185 | + .atomic_next = 0, |
---|
| 186 | + .atomic_nest_count = 0, |
---|
| 187 | + .in_flat_atomic = false, |
---|
| 188 | + .access_mask = 0, |
---|
| 189 | + .scoped_accesses = {LIST_POISON1, NULL}, |
---|
| 190 | + }, |
---|
165 | 191 | #endif |
---|
166 | 192 | #ifdef CONFIG_TRACE_IRQFLAGS |
---|
167 | 193 | .softirqs_enabled = 1, |
---|
168 | 194 | #endif |
---|
169 | 195 | #ifdef CONFIG_LOCKDEP |
---|
| 196 | + .lockdep_depth = 0, /* no locks held yet */ |
---|
| 197 | + .curr_chain_key = INITIAL_CHAIN_KEY, |
---|
170 | 198 | .lockdep_recursion = 0, |
---|
171 | 199 | #endif |
---|
172 | 200 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
---|
173 | 201 | .ret_stack = NULL, |
---|
174 | 202 | .tracing_graph_pause = ATOMIC_INIT(0), |
---|
175 | 203 | #endif |
---|
176 | | -#if defined(CONFIG_TRACING) && defined(CONFIG_PREEMPT) |
---|
| 204 | +#if defined(CONFIG_TRACING) && defined(CONFIG_PREEMPTION) |
---|
177 | 205 | .trace_recursion = 0, |
---|
178 | 206 | #endif |
---|
179 | 207 | #ifdef CONFIG_LIVEPATCH |
---|
.. | .. |
---|
182 | 210 | #ifdef CONFIG_SECURITY |
---|
183 | 211 | .security = NULL, |
---|
184 | 212 | #endif |
---|
| 213 | +#ifdef CONFIG_SECCOMP_FILTER |
---|
| 214 | + .seccomp = { .filter_count = ATOMIC_INIT(0) }, |
---|
| 215 | +#endif |
---|
| 216 | +#ifdef CONFIG_ANDROID_VENDOR_OEM_DATA |
---|
| 217 | + .android_vendor_data1 = {0, }, |
---|
| 218 | + .android_oem_data1 = {0, }, |
---|
| 219 | +#endif |
---|
185 | 220 | }; |
---|
186 | 221 | EXPORT_SYMBOL(init_task); |
---|
187 | | - |
---|
188 | | -#ifdef CONFIG_SHADOW_CALL_STACK |
---|
189 | | -unsigned long init_shadow_call_stack[SCS_SIZE / sizeof(long)] __init_task_data |
---|
190 | | - __aligned(SCS_SIZE) = { |
---|
191 | | - [(SCS_SIZE / sizeof(long)) - 1] = SCS_END_MAGIC |
---|
192 | | -}; |
---|
193 | | -#endif |
---|
194 | 222 | |
---|
195 | 223 | /* |
---|
196 | 224 | * Initial thread structure. Alignment of this is handled by a special |
---|