All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Subject: [PULL 08/11] ati-vga: Add upper limit to x-linear-aper-size property
Date: Tue, 31 Mar 2026 15:15:10 +0200	[thread overview]
Message-ID: <20260331131514.21152-9-philmd@linaro.org> (raw)
In-Reply-To: <20260331131514.21152-1-philmd@linaro.org>

From: BALATON Zoltan <balaton@eik.bme.hu>

Coverity warns in CID 1645968 about possible integer overflow. This
should never happen but to ensure that, add an upper limit on the
x-linear-aper-size. This may not silence the warning but makes sure
users cannot cause an overflow.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <541ffffdaa4c67b9dcbca6c2498e69b137bce95d.1774904832.git.balaton@eik.bme.hu>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/display/ati.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/display/ati.c b/hw/display/ati.c
index fc19737d1f0..97d871b1e22 100644
--- a/hw/display/ati.c
+++ b/hw/display/ati.c
@@ -1130,6 +1130,10 @@ static void ati_vga_realize(PCIDevice *dev, Error **errp)
             s->linear_aper_sz = ATI_R100_LINEAR_APER_SIZE;
         }
     }
+    if (s->linear_aper_sz > 256 * MiB) {
+        error_setg(errp, "x-linear-aper-size is too large (maximum 256 MiB)");
+        return;
+    }
     if (s->linear_aper_sz < 16 * MiB) {
         error_setg(errp, "x-linear-aper-size is too small (minimum 16 MiB)");
         return;
-- 
2.53.0



  parent reply	other threads:[~2026-03-31 13:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-31 13:15 [PULL 00/11] Misc HW patches for 2026-03-31 Philippe Mathieu-Daudé
2026-03-31 13:15 ` [PULL 01/11] ppc/pnv: generate dtb after machine initialization is complete Philippe Mathieu-Daudé
2026-03-31 13:15 ` [PULL 02/11] MAINTAINERS: Separate QDev section from QOM one Philippe Mathieu-Daudé
2026-03-31 13:15 ` [PULL 03/11] target/mips: save CP0 timer in vmstate Philippe Mathieu-Daudé
2026-03-31 13:15 ` [PULL 04/11] backends/igvm: switch to PRIx64 Philippe Mathieu-Daudé
2026-03-31 13:15 ` [PULL 05/11] target/i386/cpu.c: Correct minor grammar error in warning Philippe Mathieu-Daudé
2026-03-31 13:15 ` [PULL 06/11] target/i386: Treat qtest like TCG for supported-features Philippe Mathieu-Daudé
2026-03-31 13:15 ` [PULL 07/11] ati-vga: Silence warning about operator precedence Philippe Mathieu-Daudé
2026-03-31 13:15 ` Philippe Mathieu-Daudé [this message]
2026-03-31 13:15 ` [PULL 09/11] hw/pci-host/astro: Update copyright and documentation link Philippe Mathieu-Daudé
2026-03-31 13:15 ` [PULL 10/11] hw/hppa: Disable Artist graphics card on 64-bit machines Philippe Mathieu-Daudé
2026-03-31 13:15 ` [PULL 11/11] MAINTAINERS: fix OSUOSL typo Philippe Mathieu-Daudé
2026-03-31 16:34 ` [PULL 00/11] Misc HW patches for 2026-03-31 Peter Maydell

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=20260331131514.21152-9-philmd@linaro.org \
    --to=philmd@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.