• Oleg Nesterov's avatar
    pids: fix fork_idle() to setup ->pids correctly · f106eee1
    Oleg Nesterov authored
    copy_process(pid => &init_struct_pid) doesn't do attach_pid/etc.
    
    It shouldn't, but this means that the idle threads run with the wrong
    pids copied from the caller's task_struct. In x86 case the caller is
    either kernel_init() thread or keventd.
    
    In particular, this means that after the series of cpu_up/cpu_down an
    idle thread (which never exits) can run with .pid pointing to nowhere.
    
    Change fork_idle() to initialize idle->pids[] correctly. We only set
    .pid = &init_struct_pid but do not add .node to list, INIT_TASK() does
    the same for the boot-cpu idle thread (swapper).
    Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
    Cc: Cedric Le Goater <clg@fr.ibm.com>
    Cc: Dave Hansen <haveblue@us.ibm.com>
    Cc: Eric Biederman <ebiederm@xmission.com>
    Cc: Herbert Poetzl <herbert@13thfloor.at>
    Cc: Mathias Krause <Mathias.Krause@secunet.com>
    Acked-by: default avatarRoland McGrath <roland@redhat.com>
    Acked-by: default avatarSerge Hallyn <serue@us.ibm.com>
    Cc: Sukadev Bhattiprolu <sukadev@us.ibm.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    f106eee1
Name
Last commit
Last update
..
debug Loading commit data...
gcov Loading commit data...
irq Loading commit data...
power Loading commit data...
time Loading commit data...
trace Loading commit data...
.gitignore Loading commit data...
Kconfig.freezer Loading commit data...
Kconfig.hz Loading commit data...
Kconfig.locks Loading commit data...
Kconfig.preempt Loading commit data...
Makefile Loading commit data...
acct.c Loading commit data...
async.c Loading commit data...
audit.c Loading commit data...
audit.h Loading commit data...
audit_tree.c Loading commit data...
audit_watch.c Loading commit data...
auditfilter.c Loading commit data...
auditsc.c Loading commit data...
backtracetest.c Loading commit data...
bounds.c Loading commit data...
capability.c Loading commit data...
cgroup.c Loading commit data...
cgroup_freezer.c Loading commit data...
compat.c Loading commit data...
configs.c Loading commit data...
cpu.c Loading commit data...
cpuset.c Loading commit data...
cred.c Loading commit data...
delayacct.c Loading commit data...
dma.c Loading commit data...
early_res.c Loading commit data...
elfcore.c Loading commit data...
exec_domain.c Loading commit data...
exit.c Loading commit data...
extable.c Loading commit data...
fork.c Loading commit data...
freezer.c Loading commit data...
futex.c Loading commit data...
futex_compat.c Loading commit data...
groups.c Loading commit data...
hrtimer.c Loading commit data...
hung_task.c Loading commit data...
hw_breakpoint.c Loading commit data...
itimer.c Loading commit data...
kallsyms.c Loading commit data...
kexec.c Loading commit data...
kfifo.c Loading commit data...
kmod.c Loading commit data...
kprobes.c Loading commit data...
ksysfs.c Loading commit data...
kthread.c Loading commit data...
latencytop.c Loading commit data...
lockdep.c Loading commit data...
lockdep_internals.h Loading commit data...
lockdep_proc.c Loading commit data...
lockdep_states.h Loading commit data...
module.c Loading commit data...
mutex-debug.c Loading commit data...
mutex-debug.h Loading commit data...
mutex.c Loading commit data...
mutex.h Loading commit data...
notifier.c Loading commit data...
ns_cgroup.c Loading commit data...
nsproxy.c Loading commit data...
padata.c Loading commit data...
panic.c Loading commit data...
params.c Loading commit data...
perf_event.c Loading commit data...
pid.c Loading commit data...
pid_namespace.c Loading commit data...
pm_qos_params.c Loading commit data...
posix-cpu-timers.c Loading commit data...
posix-timers.c Loading commit data...
printk.c Loading commit data...
profile.c Loading commit data...
ptrace.c Loading commit data...
range.c Loading commit data...
rcupdate.c Loading commit data...
rcutiny.c Loading commit data...
rcutiny_plugin.h Loading commit data...
rcutorture.c Loading commit data...
rcutree.c Loading commit data...
rcutree.h Loading commit data...
rcutree_plugin.h Loading commit data...
rcutree_trace.c Loading commit data...
relay.c Loading commit data...
res_counter.c Loading commit data...
resource.c Loading commit data...
rtmutex-debug.c Loading commit data...
rtmutex-debug.h Loading commit data...
rtmutex-tester.c Loading commit data...
rtmutex.c Loading commit data...
rtmutex.h Loading commit data...
rtmutex_common.h Loading commit data...
rwsem.c Loading commit data...
sched.c Loading commit data...
sched_clock.c Loading commit data...
sched_cpupri.c Loading commit data...
sched_cpupri.h Loading commit data...
sched_debug.c Loading commit data...
sched_fair.c Loading commit data...
sched_features.h Loading commit data...
sched_idletask.c Loading commit data...
sched_rt.c Loading commit data...
sched_stats.h Loading commit data...
seccomp.c Loading commit data...
semaphore.c Loading commit data...
signal.c Loading commit data...
slow-work-debugfs.c Loading commit data...
slow-work.c Loading commit data...
slow-work.h Loading commit data...
smp.c Loading commit data...
softirq.c Loading commit data...
softlockup.c Loading commit data...
spinlock.c Loading commit data...
srcu.c Loading commit data...
stacktrace.c Loading commit data...
stop_machine.c Loading commit data...
sys.c Loading commit data...
sys_ni.c Loading commit data...
sysctl.c Loading commit data...
sysctl_binary.c Loading commit data...
sysctl_check.c Loading commit data...
taskstats.c Loading commit data...
test_kprobes.c Loading commit data...
time.c Loading commit data...
timeconst.pl Loading commit data...
timer.c Loading commit data...
tracepoint.c Loading commit data...
tsacct.c Loading commit data...
uid16.c Loading commit data...
up.c Loading commit data...
user-return-notifier.c Loading commit data...
user.c Loading commit data...
user_namespace.c Loading commit data...
utsname.c Loading commit data...
utsname_sysctl.c Loading commit data...
wait.c Loading commit data...
workqueue.c Loading commit data...