# Re: \[PATCH 3/8\] cfq-iosched: fix oom cfq\_queue ref leak in cfq\_set\_request()

- From: Jeff Moyer \<hidden\>
- Date: 2015-06-08 18:51:49 
- List: cgroups
- Page: https://ratatoskr.run/cgroups/2015/06/4511328
- Thread: https://ratatoskr.run/cgroups/2015/06/4511328/t.md

```text
Tejun Heo [ref] writes:

> 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 <redacted>
> Cc: Vivek Goyal <redacted>
> Cc: Arianna Avanzini <redacted>

Reviewed-by: Jeff Moyer <redacted>
```
