diff options
author | David Hildenbrand <[email protected]> | 2014-09-18 11:04:31 +0200 |
---|---|---|
committer | Jens Axboe <[email protected]> | 2014-09-22 11:55:14 -0600 |
commit | 683d0e126232d898a481daa3a4ca032c2b1a9660 (patch) | |
tree | ce6bf69626d6b1b11cd3fb69bb31db506fe77704 /net/lapb/lapb_subr.c | |
parent | 538b75341835e3c2041ff066408de10d24fdc830 (diff) |
blk-mq: Avoid race condition with uninitialized requests
This patch should fix the bug reported in
https://lkml.org/lkml/2014/9/11/249.
We have to initialize at least the atomic_flags and the cmd_flags when
allocating storage for the requests.
Otherwise blk_mq_timeout_check() might dereference uninitialized
pointers when racing with the creation of a request.
Also move the reset of cmd_flags for the initializing code to the point
where a request is freed. So we will never end up with pending flush
request indicators that might trigger dereferences of invalid pointers
in blk_mq_timeout_check().
Cc: [email protected]
Signed-off-by: David Hildenbrand <[email protected]>
Reported-by: Paulo De Rezende Pinatti <[email protected]>
Tested-by: Paulo De Rezende Pinatti <[email protected]>
Acked-by: Christian Borntraeger <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'net/lapb/lapb_subr.c')
0 files changed, 0 insertions, 0 deletions