Skip to content
Commit 5dfe6114 authored by Davidlohr Bueso's avatar Davidlohr Bueso Committed by Greg Kroah-Hartman
Browse files

block: fix ioprio_get(IOPRIO_WHO_PGRP) vs setuid(2)



commit e6a59aac upstream.

do_each_pid_thread(PIDTYPE_PGID) can race with a concurrent
change_pid(PIDTYPE_PGID) that can move the task from one hlist
to another while iterating. Serialize ioprio_get to take
the tasklist_lock in this case, just like it's set counterpart.

Fixes: d69b78ba (ioprio: grab rcu_read_lock in sys_ioprio_{set,get}())
Acked-by: default avatarOleg Nesterov <oleg@redhat.com>
Signed-off-by: default avatarDavidlohr Bueso <dbueso@suse.de>
Link: https://lore.kernel.org/r/20211210182058.43417-1-dave@stgolabs.net


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5f1f94c2
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment