qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>, qemu-devel@nongnu.org
Cc: Prasad J Pandit <ppandit@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] fmops: fix off-by-one in AR_TABLE and DR_TABLE array size
Date: Tue, 30 Oct 2018 09:45:27 +0100	[thread overview]
Message-ID: <c6c8e609-9daa-0f60-81d0-50d51db5ba3a@redhat.com> (raw)
In-Reply-To: <20181030082340.17170-1-kraxel@redhat.com>

Hi Gerd,

On 30/10/18 9:23, Gerd Hoffmann wrote:

Can you add your previous patch description,

   We have a lovely, guest-triggerable buffer overflow in opl2 emulation.

   Reproducer:
       outw(0xff60, 0x220);
       outw(0x1020, 0x220);
       outw(0xffb0, 0x220);
   Result:
       Will overflow FM_OPL->AR_TABLE[] (see hw/audio/fmopl.[ch])

And Prasad Pandit triggering flow:

   In set_ar_dr

     SLOT->AR = ar ? &OPL->AR_TABLE[ar<<2] : RATE_0;

   SLOT->AR is set to point to OPL->DR_TABLE[60] and while so if s->ksr
   is set to 15, in CALC_FCSLOT()

   SLOT->evsa = SLOT->AR[ksr];  <= accesses OPL->AR_TABLE[60 + 15];

Thanks.

> Fixes: CVE-2018-???
> Cc: P J P <ppandit@redhat.com>
> Reported-by: Wangjunqing <wangjunqing@huawei.com>
> Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> ---
>   hw/audio/fmopl.h | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/audio/fmopl.h b/hw/audio/fmopl.h
> index e7e578a48e..7199afaa3c 100644
> --- a/hw/audio/fmopl.h
> +++ b/hw/audio/fmopl.h
> @@ -72,8 +72,8 @@ typedef struct fm_opl_f {
>   	/* Rhythm sention */
>   	uint8_t rhythm;		/* Rhythm mode , key flag */
>   	/* time tables */
> -	int32_t AR_TABLE[75];	/* atttack rate tables */
> -	int32_t DR_TABLE[75];	/* decay rate tables   */
> +	int32_t AR_TABLE[76];	/* atttack rate tables */
> +	int32_t DR_TABLE[76];	/* decay rate tables   */
>   	uint32_t FN_TABLE[1024];  /* fnumber -> increment counter */
>   	/* LFO */
>   	int32_t *ams_table;
> 

  reply	other threads:[~2018-10-30  8:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-30  8:23 [Qemu-devel] [PATCH] fmops: fix off-by-one in AR_TABLE and DR_TABLE array size Gerd Hoffmann
2018-10-30  8:45 ` Philippe Mathieu-Daudé [this message]
2018-10-31  5:02 ` no-reply
2018-10-31 14:10   ` Philippe Mathieu-Daudé
2018-11-12 13:18 ` Gerd Hoffmann
2018-11-21 10:49   ` P J P
2018-11-21 13:07     ` Gerd Hoffmann
2018-11-27  7:30 ` Thomas Huth

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=c6c8e609-9daa-0f60-81d0-50d51db5ba3a@redhat.com \
    --to=philmd@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=ppandit@redhat.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).