Skip to content
Commit 8d61413d authored by Sagi Grimberg's avatar Sagi Grimberg Committed by Jens Axboe
Browse files

nvmet-rdma: Fix a possible uninitialized variable dereference



When handling a new recv command, we grab a new rsp resource and
check for the queue state being live. In case the queue is not in
live state, we simply restore the rsp back to the free list. However
in this flow we didn't set rsp->queue yet, so we cannot dereference it.

Instead, make sure to initialize rsp->queue (and other rsp members)
as soon as possible so we won't reference uninitialized variables.

Reported-by: default avatarYi Zhang <yizhan@redhat.com>
Reported-by: default avatarRaju Rangoju <rajur@chelsio.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Tested-by: default avatarRaju Rangoju <rajur@chelsio.com>
Signed-off-by: default avatarSagi Grimberg <sagi@grimberg.me>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent 427242ce
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment