* [brauner:clone_into_cgroup 1/2] kernel/fork.c:2171:11: error: implicit declaration of function 'cgroup_fork_css_set_find'; did you mean 'cgroup_post_fork'?
@ 2019-12-08 17:44 kbuild test robot
0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2019-12-08 17:44 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 13140 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux.git clone_into_cgroup
head: 5975ba59d3593da3c54c35a88c71ad6488160774
commit: 8e3298923fbe038330618fb290c2694e01cc6760 [1/2] [WIP]: clone3: clone into cgroup
config: i386-tinyconfig (attached as .config)
compiler: gcc-7 (Debian 7.5.0-1) 7.5.0
reproduce:
git checkout 8e3298923fbe038330618fb290c2694e01cc6760
# save the attached .config to linux build tree
make ARCH=i386
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
kernel/fork.c: In function 'copy_process':
>> kernel/fork.c:2171:11: error: implicit declaration of function 'cgroup_fork_css_set_find'; did you mean 'cgroup_post_fork'? [-Werror=implicit-function-declaration]
retval = cgroup_fork_css_set_find(current, args);
^~~~~~~~~~~~~~~~~~~~~~~~
cgroup_post_fork
>> kernel/fork.c:2181:11: error: too many arguments to function 'cgroup_can_fork'
retval = cgroup_can_fork(p, args);
^~~~~~~~~~~~~~~
In file included from kernel/fork.c:49:0:
include/linux/cgroup.h:716:19: note: declared here
static inline int cgroup_can_fork(struct task_struct *p) { return 0; }
^~~~~~~~~~~~~~~
>> kernel/fork.c:2288:2: error: too many arguments to function 'cgroup_post_fork'
cgroup_post_fork(p, args);
^~~~~~~~~~~~~~~~
In file included from kernel/fork.c:49:0:
include/linux/cgroup.h:718:20: note: declared here
static inline void cgroup_post_fork(struct task_struct *p) {}
^~~~~~~~~~~~~~~~
kernel/fork.c:1835:17: warning: unused variable 'cgrp' [-Wunused-variable]
struct cgroup *cgrp = NULL;
^~~~
cc1: some warnings being treated as errors
vim +2171 kernel/fork.c
2041
2042 /* Perform scheduler related setup. Assign this task to a CPU. */
2043 retval = sched_fork(clone_flags, p);
2044 if (retval)
2045 goto bad_fork_cleanup_policy;
2046
2047 retval = perf_event_init_task(p);
2048 if (retval)
2049 goto bad_fork_cleanup_policy;
2050 retval = audit_alloc(p);
2051 if (retval)
2052 goto bad_fork_cleanup_perf;
2053 /* copy all the process information */
2054 shm_init_task(p);
2055 retval = security_task_alloc(p, clone_flags);
2056 if (retval)
2057 goto bad_fork_cleanup_audit;
2058 retval = copy_semundo(clone_flags, p);
2059 if (retval)
2060 goto bad_fork_cleanup_security;
2061 retval = copy_files(clone_flags, p);
2062 if (retval)
2063 goto bad_fork_cleanup_semundo;
2064 retval = copy_fs(clone_flags, p);
2065 if (retval)
2066 goto bad_fork_cleanup_files;
2067 retval = copy_sighand(clone_flags, p);
2068 if (retval)
2069 goto bad_fork_cleanup_fs;
2070 retval = copy_signal(clone_flags, p);
2071 if (retval)
2072 goto bad_fork_cleanup_sighand;
2073 retval = copy_mm(clone_flags, p);
2074 if (retval)
2075 goto bad_fork_cleanup_signal;
2076 retval = copy_namespaces(clone_flags, p);
2077 if (retval)
2078 goto bad_fork_cleanup_mm;
2079 retval = copy_io(clone_flags, p);
2080 if (retval)
2081 goto bad_fork_cleanup_namespaces;
2082 retval = copy_thread_tls(clone_flags, args->stack, args->stack_size, p,
2083 args->tls);
2084 if (retval)
2085 goto bad_fork_cleanup_io;
2086
2087 stackleak_task_init(p);
2088
2089 if (pid != &init_struct_pid) {
2090 pid = alloc_pid(p->nsproxy->pid_ns_for_children, args->set_tid,
2091 args->set_tid_size);
2092 if (IS_ERR(pid)) {
2093 retval = PTR_ERR(pid);
2094 goto bad_fork_cleanup_thread;
2095 }
2096 }
2097
2098 /*
2099 * This has to happen after we've potentially unshared the file
2100 * descriptor table (so that the pidfd doesn't leak into the child
2101 * if the fd table isn't shared).
2102 */
2103 if (clone_flags & CLONE_PIDFD) {
2104 retval = get_unused_fd_flags(O_RDWR | O_CLOEXEC);
2105 if (retval < 0)
2106 goto bad_fork_free_pid;
2107
2108 pidfd = retval;
2109
2110 pidfile = anon_inode_getfile("[pidfd]", &pidfd_fops, pid,
2111 O_RDWR | O_CLOEXEC);
2112 if (IS_ERR(pidfile)) {
2113 put_unused_fd(pidfd);
2114 retval = PTR_ERR(pidfile);
2115 goto bad_fork_free_pid;
2116 }
2117 get_pid(pid); /* held by pidfile now */
2118
2119 retval = put_user(pidfd, args->pidfd);
2120 if (retval)
2121 goto bad_fork_put_pidfd;
2122 }
2123
2124 #ifdef CONFIG_BLOCK
2125 p->plug = NULL;
2126 #endif
2127 futex_init_task(p);
2128
2129 /*
2130 * sigaltstack should be cleared when sharing the same VM
2131 */
2132 if ((clone_flags & (CLONE_VM|CLONE_VFORK)) == CLONE_VM)
2133 sas_ss_reset(p);
2134
2135 /*
2136 * Syscall tracing and stepping should be turned off in the
2137 * child regardless of CLONE_PTRACE.
2138 */
2139 user_disable_single_step(p);
2140 clear_tsk_thread_flag(p, TIF_SYSCALL_TRACE);
2141 #ifdef TIF_SYSCALL_EMU
2142 clear_tsk_thread_flag(p, TIF_SYSCALL_EMU);
2143 #endif
2144 clear_tsk_latency_tracing(p);
2145
2146 /* ok, now we should be set up.. */
2147 p->pid = pid_nr(pid);
2148 if (clone_flags & CLONE_THREAD) {
2149 p->exit_signal = -1;
2150 p->group_leader = current->group_leader;
2151 p->tgid = current->tgid;
2152 } else {
2153 if (clone_flags & CLONE_PARENT)
2154 p->exit_signal = current->group_leader->exit_signal;
2155 else
2156 p->exit_signal = args->exit_signal;
2157 p->group_leader = p;
2158 p->tgid = p->pid;
2159 }
2160
2161 p->nr_dirtied = 0;
2162 p->nr_dirtied_pause = 128 >> (PAGE_SHIFT - 10);
2163 p->dirty_paused_when = 0;
2164
2165 p->pdeath_signal = 0;
2166 INIT_LIST_HEAD(&p->thread_group);
2167 p->task_works = NULL;
2168
2169 cgroup_threadgroup_change_begin(current);
2170
> 2171 retval = cgroup_fork_css_set_find(current, args);
2172 if (retval)
2173 goto bad_fork_cgroup_threadgroup_change_end;
2174
2175 /*
2176 * Ensure that the cgroup subsystem policies allow the new process to be
2177 * forked. It should be noted the the new process's css_set can be changed
2178 * between here and cgroup_post_fork() if an organisation operation is in
2179 * progress.
2180 */
> 2181 retval = cgroup_can_fork(p, args);
2182 if (retval)
2183 goto bad_fork_cgroup_threadgroup_change_end;
2184
2185 /*
2186 * From this point on we must avoid any synchronous user-space
2187 * communication until we take the tasklist-lock. In particular, we do
2188 * not want user-space to be able to predict the process start-time by
2189 * stalling fork(2) after we recorded the start_time but before it is
2190 * visible to the system.
2191 */
2192
2193 p->start_time = ktime_get_ns();
2194 p->real_start_time = ktime_get_boottime_ns();
2195
2196 /*
2197 * Make it visible to the rest of the system, but dont wake it up yet.
2198 * Need tasklist lock for parent etc handling!
2199 */
2200 write_lock_irq(&tasklist_lock);
2201
2202 /* CLONE_PARENT re-uses the old parent */
2203 if (clone_flags & (CLONE_PARENT|CLONE_THREAD)) {
2204 p->real_parent = current->real_parent;
2205 p->parent_exec_id = current->parent_exec_id;
2206 } else {
2207 p->real_parent = current;
2208 p->parent_exec_id = current->self_exec_id;
2209 }
2210
2211 klp_copy_process(p);
2212
2213 spin_lock(¤t->sighand->siglock);
2214
2215 /*
2216 * Copy seccomp details explicitly here, in case they were changed
2217 * before holding sighand lock.
2218 */
2219 copy_seccomp(p);
2220
2221 rseq_fork(p, clone_flags);
2222
2223 /* Don't start children in a dying pid namespace */
2224 if (unlikely(!(ns_of_pid(pid)->pid_allocated & PIDNS_ADDING))) {
2225 retval = -ENOMEM;
2226 goto bad_fork_cancel_cgroup;
2227 }
2228
2229 /* Let kill terminate clone/fork in the middle */
2230 if (fatal_signal_pending(current)) {
2231 retval = -EINTR;
2232 goto bad_fork_cancel_cgroup;
2233 }
2234
2235 /* past the last point of failure */
2236 if (pidfile)
2237 fd_install(pidfd, pidfile);
2238
2239 init_task_pid_links(p);
2240 if (likely(p->pid)) {
2241 ptrace_init_task(p, (clone_flags & CLONE_PTRACE) || trace);
2242
2243 init_task_pid(p, PIDTYPE_PID, pid);
2244 if (thread_group_leader(p)) {
2245 init_task_pid(p, PIDTYPE_TGID, pid);
2246 init_task_pid(p, PIDTYPE_PGID, task_pgrp(current));
2247 init_task_pid(p, PIDTYPE_SID, task_session(current));
2248
2249 if (is_child_reaper(pid)) {
2250 ns_of_pid(pid)->child_reaper = p;
2251 p->signal->flags |= SIGNAL_UNKILLABLE;
2252 }
2253 p->signal->shared_pending.signal = delayed.signal;
2254 p->signal->tty = tty_kref_get(current->signal->tty);
2255 /*
2256 * Inherit has_child_subreaper flag under the same
2257 * tasklist_lock with adding child to the process tree
2258 * for propagate_has_child_subreaper optimization.
2259 */
2260 p->signal->has_child_subreaper = p->real_parent->signal->has_child_subreaper ||
2261 p->real_parent->signal->is_child_subreaper;
2262 list_add_tail(&p->sibling, &p->real_parent->children);
2263 list_add_tail_rcu(&p->tasks, &init_task.tasks);
2264 attach_pid(p, PIDTYPE_TGID);
2265 attach_pid(p, PIDTYPE_PGID);
2266 attach_pid(p, PIDTYPE_SID);
2267 __this_cpu_inc(process_counts);
2268 } else {
2269 current->signal->nr_threads++;
2270 atomic_inc(¤t->signal->live);
2271 refcount_inc(¤t->signal->sigcnt);
2272 task_join_group_stop(p);
2273 list_add_tail_rcu(&p->thread_group,
2274 &p->group_leader->thread_group);
2275 list_add_tail_rcu(&p->thread_node,
2276 &p->signal->thread_head);
2277 }
2278 attach_pid(p, PIDTYPE_PID);
2279 nr_threads++;
2280 }
2281 total_forks++;
2282 hlist_del_init(&delayed.node);
2283 spin_unlock(¤t->sighand->siglock);
2284 syscall_tracepoint_update(p);
2285 write_unlock_irq(&tasklist_lock);
2286
2287 proc_fork_connector(p);
> 2288 cgroup_post_fork(p, args);
2289 cgroup_threadgroup_change_end(current);
2290 perf_event_fork(p);
2291
2292 trace_task_newtask(p, clone_flags);
2293 uprobe_copy_process(p, clone_flags);
2294
2295 return p;
2296
2297 bad_fork_cancel_cgroup:
2298 spin_unlock(¤t->sighand->siglock);
2299 write_unlock_irq(&tasklist_lock);
2300 cgroup_cancel_fork(p);
2301 bad_fork_cgroup_threadgroup_change_end:
2302 cgroup_threadgroup_change_end(current);
2303 bad_fork_put_pidfd:
2304 if (clone_flags & CLONE_PIDFD) {
2305 fput(pidfile);
2306 put_unused_fd(pidfd);
2307 }
2308 bad_fork_free_pid:
2309 if (pid != &init_struct_pid)
2310 free_pid(pid);
2311 bad_fork_cleanup_thread:
2312 exit_thread(p);
2313 bad_fork_cleanup_io:
2314 if (p->io_context)
2315 exit_io_context(p);
2316 bad_fork_cleanup_namespaces:
2317 exit_task_namespaces(p);
2318 bad_fork_cleanup_mm:
2319 if (p->mm) {
2320 mm_clear_owner(p->mm, p);
2321 mmput(p->mm);
2322 }
2323 bad_fork_cleanup_signal:
2324 if (!(clone_flags & CLONE_THREAD))
2325 free_signal_struct(p->signal);
2326 bad_fork_cleanup_sighand:
2327 __cleanup_sighand(p->sighand);
2328 bad_fork_cleanup_fs:
2329 exit_fs(p); /* blocking */
2330 bad_fork_cleanup_files:
2331 exit_files(p); /* blocking */
2332 bad_fork_cleanup_semundo:
2333 exit_sem(p);
2334 bad_fork_cleanup_security:
2335 security_task_free(p);
2336 bad_fork_cleanup_audit:
2337 audit_free(p);
2338 bad_fork_cleanup_perf:
2339 perf_event_free_task(p);
2340 bad_fork_cleanup_policy:
2341 lockdep_free_task(p);
2342 #ifdef CONFIG_NUMA
2343 mpol_put(p->mempolicy);
2344 bad_fork_cleanup_threadgroup_lock:
2345 #endif
2346 delayacct_tsk_free(p);
2347 bad_fork_cleanup_count:
2348 atomic_dec(&p->cred->user->processes);
2349 exit_creds(p);
2350 bad_fork_free:
2351 p->state = TASK_DEAD;
2352 put_task_stack(p);
2353 delayed_free_task(p);
2354 fork_out:
2355 spin_lock_irq(¤t->sighand->siglock);
2356 hlist_del_init(&delayed.node);
2357 spin_unlock_irq(¤t->sighand->siglock);
2358 return ERR_PTR(retval);
2359 }
2360
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 7198 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-12-08 17:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-08 17:44 [brauner:clone_into_cgroup 1/2] kernel/fork.c:2171:11: error: implicit declaration of function 'cgroup_fork_css_set_find'; did you mean 'cgroup_post_fork'? kbuild test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.