bfq-iosched: ensure to clear bic/bfqq pointers when preparing request
authorJens Axboe <[email protected]>
Tue, 17 Apr 2018 23:08:52 +0000 (17:08 -0600)
committerJens Axboe <[email protected]>
Tue, 17 Apr 2018 23:08:52 +0000 (17:08 -0600)
commit72961c4e6082be79825265d9193272b8a1634dec
treedb6b683240483097d30a95f1de6abaff2414dd55
parentf4560231ec42092c6662acccabb28c6cac9f5dfb
bfq-iosched: ensure to clear bic/bfqq pointers when preparing request

Even if we don't have an IO context attached to a request, we still
need to clear the priv[0..1] pointers, as they could be pointing
to previously used bic/bfqq structures. If we don't do so, we'll
either corrupt memory on dispatching a request, or cause an
imbalance in counters.

Inspired by a fix from Kees.

Reported-by: Oleksandr Natalenko <[email protected]>
Reported-by: Kees Cook <[email protected]>
Cc: [email protected]
Fixes: aee69d78dec0 ("block, bfq: introduce the BFQ-v0 I/O scheduler as an extra scheduler")
Signed-off-by: Jens Axboe <[email protected]>
block/bfq-iosched.c