qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Qiang Liu <cyruscyliu@gmail.com>,
	Dmitry Fleytman <dmitry.fleytman@gmail.com>,
	qemu-devel@nongnu.org
Subject: Re: [PATCH qemu] hw/net/vmxnet3: Remove g_assert_not_reached() when VMXNET3_REG_ICR is written
Date: Wed, 23 Jun 2021 11:23:17 +0800	[thread overview]
Message-ID: <baf2e00f-b8ed-920b-2bcb-f5aecbdd20e7@redhat.com> (raw)
In-Reply-To: <CAAKa2jm_4noz=rVc-vW6-4q-HsJtLoZXUZJfoHprjpLmYgb1EA@mail.gmail.com>


在 2021/6/23 上午10:26, Qiang Liu 写道:
> From: cyruscyliu <cyruscyliu@gmail.com>
>
> A malicious guest user can write VMXNET3_REG_ICR to crash QEMU. This
> patch remove the g_aasert_not_reached() there and make the access pass.
>
> Fixes: 786fd2b0f87 ("VMXNET3 device implementation")
> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/309
> Buglink: https://bugs.launchpad.net/qemu/+bug/1913923
>
> Signed-off-by: Qiang Liu <cyruscyliu@gmail.com>


Do we need to warn about the unimplemented register?

Thanks


> ---
>   hw/net/vmxnet3.c | 7 -------
>   1 file changed, 7 deletions(-)
>
> diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
> index eff299f629..a388918479 100644
> --- a/hw/net/vmxnet3.c
> +++ b/hw/net/vmxnet3.c
> @@ -1786,13 +1786,6 @@ vmxnet3_io_bar1_write(void *opaque,
>           vmxnet3_set_variable_mac(s, val, s->temp_mac);
>           break;
>
> -    /* Interrupt Cause Register */
> -    case VMXNET3_REG_ICR:
> -        VMW_CBPRN("Write BAR1 [VMXNET3_REG_ICR] = %" PRIx64 ", size %d",
> -                  val, size);
> -        g_assert_not_reached();
> -        break;
> -
>       /* Event Cause Register */
>       case VMXNET3_REG_ECR:
>           VMW_CBPRN("Write BAR1 [VMXNET3_REG_ECR] = %" PRIx64 ", size %d",
> --
> 2.30.2
>



  reply	other threads:[~2021-06-23  3:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <162441284292.15618.4627728437912000813-0@git.sr.ht>
2021-06-23  2:26 ` [PATCH qemu] hw/net/vmxnet3: Remove g_assert_not_reached() when VMXNET3_REG_ICR is written Qiang Liu
2021-06-23  3:23   ` Jason Wang [this message]
2021-06-25  2:19     ` Qiang Liu
2021-06-25  2:57       ` Jason Wang

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=baf2e00f-b8ed-920b-2bcb-f5aecbdd20e7@redhat.com \
    --to=jasowang@redhat.com \
    --cc=cyruscyliu@gmail.com \
    --cc=dmitry.fleytman@gmail.com \
    --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).