]> git.baikalelectronics.ru Git - kernel.git/commit
cfq-iosched: fix oom cfq_queue ref leak in cfq_set_request()
authorTejun Heo <tj@kernel.org>
Tue, 18 Aug 2015 21:54:59 +0000 (14:54 -0700)
committerJens Axboe <axboe@fb.com>
Tue, 18 Aug 2015 22:49:16 +0000 (15:49 -0700)
commitbcb0e5d758cfb496768c6763a7bb60c761bf6db7
tree58cea8112fb0e35d94ff30f9d30184c7b424d66f
parent47f19af2125546094efb7eec0c50598e3c98e48d
cfq-iosched: fix oom cfq_queue ref leak in cfq_set_request()

If the cfq_queue cached in cfq_io_cq is the oom one, cfq_set_request()
replaces it by invoking cfq_get_queue() again without putting the oom
queue leaking the reference it was holding.  While oom queues are not
released through reference counting, they're still reference counted
and this can theoretically lead to the reference count overflowing and
incorrectly invoke the usual release path on it.

Fix it by making cfq_set_request() put the ref it was holding.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Jeff Moyer <jmoyer@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Cc: Arianna Avanzini <avanzini.arianna@gmail.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/cfq-iosched.c