]> git.baikalelectronics.ru Git - kernel.git/commit
loop: remove union of use_aio and ref in struct loop_cmd
authorOmar Sandoval <osandov@fb.com>
Wed, 20 Sep 2017 21:24:34 +0000 (14:24 -0700)
committerJens Axboe <axboe@kernel.dk>
Mon, 25 Sep 2017 14:56:05 +0000 (08:56 -0600)
commit0401c42c5737105484f4ae125f1ffd346cf597ec
tree0e2440f48680900a99bcd9e3e9b3333f11b1a000
parentabbddef58baa59b28e86f8bbccb840102d00f453
loop: remove union of use_aio and ref in struct loop_cmd

When the request is completed, lo_complete_rq() checks cmd->use_aio.
However, if this is in fact an aio request, cmd->use_aio will have
already been reused as cmd->ref by lo_rw_aio*. Fix it by not using a
union. On x86_64, there's a hole after the union anyways, so this
doesn't make struct loop_cmd any bigger.

Fixes: c7003b311e63 ("block/loop: fix use after free")
Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/loop.h