Schedule find_task_by_pid() for removal
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest12 patches 4 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/12 | Use find_task_by_vpid in posix timerskernel/ kernel/ | +5 | 0 replies | |
| 2/12 | Use find_task_by_vpid in autid codekernel/ | +3 | 0 replies | |
| 3/12 | Use find_task_by_vpid in taskstatskernel/ | +3 | 0 replies | |
| 4/12 | Don't operate with pid_t in rtmutex testerkernel/ kernel/ | +10 | 0 replies | |
| 5/12 | Handle pid namespaces in cgroups codekernel/ | +2 | 1 reply | |
| 6/12 | gfs2: make gfs2_glock.gl_owner_pid be a struct pid *fs/ fs/ kernel/ | +14 | 2 replies | |
| 7/12 | gfs2: make gfs2_holder.gh_owner_pid be a struct pid *fs/ fs/ fs/ | +15 | 0 replies | |
| 8/12 | frv: use find_task_by_vpid in cxn_pin_by_pidarch/ | +1 | 0 replies | |
| 9/12 | ia64: make pfm_get_task work with virtual pidsarch/ | +2 | 0 replies | |
| 10/12 | ia64: fix ptrace inside a namespacearch/ | +1 | 0 replies | |
| 11/12 | mips: use find_task_by_vpid in system callsarch/ arch/ | +2 | 0 replies | |
| 12/12 | Deprecate the find_task_by_pidDocumentation/ include/ init/ +2 more | +23 | 1 reply |
Reviews trailers per patch
1 of 12 patches has a Reviewed-by or Acked-by.
| Patch | Pavel Emelyanov | Paul Menage |
|---|---|---|
| Series | Singed-off-by | |
| 1/12 | ||
| 2/12 | ||
| 3/12 | ||
| 4/12 | ||
| 5/12 | A-b | |
| 6/12 | ||
| 7/12 | ||
| 8/12 | ||
| 9/12 | ||
| 10/12 | ||
| 11/12 | ||
| 12/12 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/12] Schedule find_task_by_pid() for removal
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 :(