Difference between task_active_pid_ns(current) and current->nsproxy->pid.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



1169        /*
1170         * If the new process will be in a different pid namespace
1171         * don't allow the creation of threads.
1172         */
1173        if ((clone_flags & (CLONE_VM|CLONE_NEWPID)) &&
1174            (task_active_pid_ns(current) != current->nsproxy->pid_ns))
1175                return ERR_PTR(-EINVAL);

Navigating through these calls, I discovered that task_active_pid_ns
calls task_pid(), which gets the struct pid attached to the
task_struct, and use this
struct as an argument to ns_of_pid() ( E.G: return ns_of_pid(task_pid(tsk)) ).

Reading the code carefully, I realized that ns_of_pid() returns the
higher level pid_namespace attached to the struct pid.
Thus, I think that the higher level pid_namespace in the struct pid
will always be the active pid_namespace.

When would task_active_pid_ns(current) be different than
current->nsproxy->pid_ns?
Sorry if this question was already asnwered somewhere, I didn't find it.

Regards,
Raphael S. Carvalho.

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux