All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/12] Schedule find_task_by_pid() for removal
@ 2008-01-29 13:38 Pavel Emelyanov
  2008-01-29 13:41 ` [PATCH 1/12] Use find_task_by_vpid in posix timers Pavel Emelyanov
                   ` (11 more replies)
  0 siblings, 12 replies; 17+ messages in thread
From: Pavel Emelyanov @ 2008-01-29 13:38 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linux Kernel Mailing List, devel, Oleg Nesterov

The function in question finds the task by its pid_t in an
initial pid namespace (init_pid_ns). This is no longer safe to
simply call it, since the current task may be in a pid namespace 
and it may return the wrong task.

The proper behavior is to call the find_task_by_vpid() if the 
caller is sure, that the target task lives in the same namespace 
as he is, or the find_task_by_pid_ns() and specify the namespace 
to find a task in.

Since the find_task_by_pid() is a well-known API call, and its
semantics changes, I think that it's better to mark it as 
deprecated to warn people, that the result may differ from what 
they expect and force them to use proper call.

Another case is to store the pointer to the struct pid of a desired
task and later call the pid_task() to get the task itself.

So this set just fixes the existing users of find_task_by_pid().
The only one will be left - the UML mconsole, but I'm completely
lost in this code, finding out what kind of pid is passed in
the mconsole_stack() call :(

Singed-off-by: Pavel Emelyanov <xemul@openvz.org>

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2008-02-01 22:28 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-29 13:38 [PATCH 0/12] Schedule find_task_by_pid() for removal Pavel Emelyanov
2008-01-29 13:41 ` [PATCH 1/12] Use find_task_by_vpid in posix timers Pavel Emelyanov
2008-01-29 13:43 ` [PATCH 2/12] Use find_task_by_vpid in autid code Pavel Emelyanov
2008-01-29 13:46 ` [PATCH 3/12] Use find_task_by_vpid in taskstats Pavel Emelyanov
2008-01-29 13:49 ` [PATCH 4/12] Don't operate with pid_t in rtmutex tester Pavel Emelyanov
2008-01-29 13:52 ` [PATCH 5/12] Handle pid namespaces in cgroups code Pavel Emelyanov
2008-01-29 18:08   ` Paul Menage
2008-01-29 13:55 ` [PATCH 6/12] gfs2: make gfs2_glock.gl_owner_pid be a struct pid * Pavel Emelyanov
2008-01-29 14:19   ` Steven Whitehouse
2008-01-29 14:33     ` Pavel Emelyanov
2008-01-29 13:57 ` [PATCH 7/12] gfs2: make gfs2_holder.gh_owner_pid " Pavel Emelyanov
2008-01-29 13:59 ` [PATCH 8/12] frv: use find_task_by_vpid in cxn_pin_by_pid Pavel Emelyanov
2008-01-29 14:02 ` [PATCH 9/12] ia64: make pfm_get_task work with virtual pids Pavel Emelyanov
2008-01-29 14:04 ` [PATCH 10/12] ia64: fix ptrace inside a namespace Pavel Emelyanov
2008-01-29 14:06 ` [PATCH 11/12] mips: use find_task_by_vpid in system calls Pavel Emelyanov
2008-01-29 14:09 ` [PATCH 12/12] Deprecate the find_task_by_pid Pavel Emelyanov
2008-02-01 22:27   ` Andrew Morton

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.