Skip to content

Commit

Permalink
block: bfq: swap puts in bfqg_and_blkg_put
Browse files Browse the repository at this point in the history
commit d5274b3 upstream.

Fix trivial use-after-free. This could be last reference to bfqg.

Fixes: 8f9bebc ("block, bfq: access and cache blkg data only when safe")
Acked-by: Paolo Valente <[email protected]>
Signed-off-by: Konstantin Khlebnikov <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
koct9i authored and gregkh committed Sep 19, 2018
1 parent 23ecbba commit 381992b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions block/bfq-cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,9 @@ static void bfqg_and_blkg_get(struct bfq_group *bfqg)

void bfqg_and_blkg_put(struct bfq_group *bfqg)
{
bfqg_put(bfqg);

blkg_put(bfqg_to_blkg(bfqg));

bfqg_put(bfqg);
}

void bfqg_stats_update_io_add(struct bfq_group *bfqg, struct bfq_queue *bfqq,
Expand Down

0 comments on commit 381992b

Please sign in to comment.