qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@kernel.org>
To: Klaus Jensen <its@irrelevant.dk>
Cc: "Klaus Jensen" <k.jensen@samsung.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	qemu-devel@nongnu.org, qemu-block@nongnu.org,
	"Qiuhao Li" <Qiuhao.Li@outlook.com>
Subject: Re: [PATCH] hw/nvme: fix CVE-2021-3929
Date: Thu, 20 Jan 2022 07:10:08 -0800	[thread overview]
Message-ID: <20220120151008.GA383746@dhcp-10-100-145-180.wdc.com> (raw)
In-Reply-To: <20220120080155.227246-1-its@irrelevant.dk>

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	other threads:[~2022-01-20 20:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-20  8:01 [PATCH] hw/nvme: fix CVE-2021-3929 Klaus Jensen
2022-01-20 15:10 ` Keith Busch [this message]
2022-01-20 20:13   ` Klaus Jensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220120151008.GA383746@dhcp-10-100-145-180.wdc.com \
    --to=kbusch@kernel.org \
    --cc=Qiuhao.Li@outlook.com \
    --cc=its@irrelevant.dk \
    --cc=k.jensen@samsung.com \
    --cc=philmd@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).