qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] hw/nvme: fix CVE-2021-3929


From: Keith Busch
Subject: Re: [PATCH] hw/nvme: fix CVE-2021-3929
Date: Thu, 20 Jan 2022 07:10:08 -0800

On Thu, Jan 20, 2022 at 09:01:55AM +0100, Klaus Jensen wrote:
> +static inline bool nvme_addr_is_iomem(NvmeCtrl *n, hwaddr addr)
> +{
> +    hwaddr hi, lo;
> +
> +    lo = n->bar0.addr;
> +    hi = lo + int128_get64(n->bar0.size);
> +
> +    return addr >= lo && addr < hi;

Looks fine considering this implementation always puts CMB in an
exclusive BAR. From a spec consideration though, you can put a CMB at a
BAR0 offset. I don't think that's going to happen anytime soon here, but
may be worth a comment to notify this function needs to be updated if
that assumption ever changes.

Reviewed-by: Keith Busch <kbusch@kernel.org>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]