nvme: fix oob access issue(CVE-2018-16847)
commit5e3c0220d7e4f0361c4d36c697a8842f2b583402
authorLi Qiang <liq3ea@gmail.com>
Fri, 2 Nov 2018 01:22:43 +0000 (1 18:22 -0700)
committerKevin Wolf <kwolf@redhat.com>
Mon, 19 Nov 2018 11:51:16 +0000 (19 12:51 +0100)
tree0b640cc5db681adc5ee152ac0d35b1054573da63
parent9436e082de18b2fb2ceed2e9d1beef641ae64f23
nvme: fix oob access issue(CVE-2018-16847)

Currently, the nvme_cmb_ops mr doesn't check the addr and size.
This can lead an oob access issue. This is triggerable in the guest.
Add check to avoid this issue.

Fixes CVE-2018-16847.

Reported-by: Li Qiang <liq3ea@gmail.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Li Qiang <liq3ea@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/block/nvme.c