OSDN Git Service

hw/nvme: fix out-of-bounds reads
authorKlaus Jensen <k.jensen@samsung.com>
Tue, 13 Jul 2021 17:24:04 +0000 (19:24 +0200)
committerKlaus Jensen <k.jensen@samsung.com>
Mon, 26 Jul 2021 19:09:39 +0000 (21:09 +0200)
commit5029de44b5352d466f1b6e7c0a9f19e1259d33b3
tree2c73635dd867fb08aea16173cc05e139eea2b851
parenta316aa50e6c9f25c22a705000271d33620a40595
hw/nvme: fix out-of-bounds reads

Peter noticed that mmio access may read into the NvmeParams member in
the NvmeCtrl struct.

Fix the bounds check.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
hw/nvme/ctrl.c