Skip to content

Commit d5274b3

Browse files
koct9iaxboe
authored andcommitted
block: bfq: swap puts in bfqg_and_blkg_put
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 <paolo.valente@linaro.org> Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 8b2ded1 commit d5274b3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

block/bfq-cgroup.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,9 @@ static void bfqg_and_blkg_get(struct bfq_group *bfqg)
275275

276276
void bfqg_and_blkg_put(struct bfq_group *bfqg)
277277
{
278-
bfqg_put(bfqg);
279-
280278
blkg_put(bfqg_to_blkg(bfqg));
279+
280+
bfqg_put(bfqg);
281281
}
282282

283283
/* @stats = 0 */

0 commit comments

Comments
 (0)