]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
bfq-iosched: ensure to clear bic/bfqq pointers when preparing request
authorJens Axboe <axboe@kernel.dk>
Tue, 17 Apr 2018 23:08:52 +0000 (17:08 -0600)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 14 Aug 2018 10:24:16 +0000 (12:24 +0200)
commit4d84faf6cc9979b61181b022c34fd3b33dbcd017
tree6f4a562e63363e790dea275f082ea6ab1d2fa879
parent87af67792b6a9b7ecc803610276d53ab3fcb2429
bfq-iosched: ensure to clear bic/bfqq pointers when preparing request

BugLink: http://bugs.launchpad.net/bugs/1778265
commit 72961c4e6082be79825265d9193272b8a1634dec upstream.

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 <oleksandr@natalenko.name>
Reported-by: Kees Cook <keescook@chromium.org>
Cc: stable@vger.kernel.org
Fixes: aee69d78dec0 ("block, bfq: introduce the BFQ-v0 I/O scheduler as an extra scheduler")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
block/bfq-iosched.c