aboutsummaryrefslogtreecommitdiffstats
path: root/fs/locks.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2020-04-30 06:43:44 -0500
committerEric W. Biederman <ebiederm@xmission.com>2020-04-30 06:43:44 -0500
commit2dd8083f6d8acd1371ccabedef1c9f1ad272a90d (patch)
tree35299020d729f847bc88ff7590cdc2d09dad903b /fs/locks.c
parentremove the no longer needed pid_alive() check in __task_pid_nr_ns() (diff)
parentposix-cpu-timers: Replace __get_task_for_clock with pid_for_clock (diff)
downloadlinux-dev-2dd8083f6d8acd1371ccabedef1c9f1ad272a90d.tar.xz
linux-dev-2dd8083f6d8acd1371ccabedef1c9f1ad272a90d.zip
posix-cpu-timers: Use pids not tasks in lookup
The current posix-cpu-timer code uses pids when holding persistent references in timers. However the lookups from clock_id_t still return tasks that need to be converted into pids for use. This results in usage being pid->task->pid and that can race with release_task and de_thread. This can lead to some not wrong but surprising results. Surprising enough that Oleg and I both thought there were some bugs in the code for a while. This set of changes modifies the code to just lookup, verify, and return pids from the clockid_t lookups to remove those potentialy troublesome races. Eric W. Biederman (3): posix-cpu-timers: Extend rcu_read_lock removing task_struct references posix-cpu-timers: Replace cpu_timer_pid_type with clock_pid_type posix-cpu-timers: Replace __get_task_for_clock with pid_for_clock kernel/time/posix-cpu-timers.c | 102 ++++++++++++++++++----------------------- 1 file changed, 45 insertions(+), 57 deletions(-) Suggested-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'fs/locks.c')
0 files changed, 0 insertions, 0 deletions