megasas: always store SCSIRequest* into MegasasCmd
commit87e459a810d7b1ec1638085b5a80ea3d9b43119a
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 1 Jun 2017 15:26:14 +0000 (1 17:26 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 15 Jun 2017 09:04:05 +0000 (15 11:04 +0200)
tree6c258c88d4560ca42b7a95efdac9de814138382c
parentb356807fcdfc45583c437f761fc579ab2a8eab11
megasas: always store SCSIRequest* into MegasasCmd

This ensures that the request is unref'ed properly, and avoids a
segmentation fault in the new qtest testcase that is added.
This is CVE-2017-9503.

Reported-by: Zhangyanyu <zyy4013@stu.ouc.edu.cn>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/scsi/megasas.c
tests/megasas-test.c