public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 2/5] lib/igt_fb: Fix 32bit integer overflow in the shadow buffer size calculation
Date: Thu, 18 Apr 2019 22:40:40 +0300	[thread overview]
Message-ID: <20190418194043.5184-2-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20190418194043.5184-1-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

16k*16k*16 == 1<<32, so 32bits isn't enough for the result when
we start to have big framebuffers.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 lib/igt_fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index f36096804fdd..d4929019971c 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -1912,7 +1912,7 @@ static void *igt_fb_create_cairo_shadow_buffer(int fd,
 		IGT_COLOR_YCBCR_BT709, IGT_COLOR_YCBCR_LIMITED_RANGE);
 
 	shadow->strides[0] = ALIGN(width * (shadow->plane_bpp[0] / 8), 16);
-	shadow->size = ALIGN(shadow->strides[0] * height,
+	shadow->size = ALIGN((uint64_t)shadow->strides[0] * height,
 			     sysconf(_SC_PAGESIZE));
 	ptr = mmap(NULL, shadow->size, PROT_READ | PROT_WRITE,
 		   MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
-- 
2.21.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2019-04-18 19:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-18 19:40 [igt-dev] [PATCH i-g-t 1/5] lib/igt_fb: Fix the cairo shadow buffer stride Ville Syrjala
2019-04-18 19:40 ` Ville Syrjala [this message]
2019-04-26 19:14   ` [igt-dev] [PATCH i-g-t 2/5] lib/igt_fb: Fix 32bit integer overflow in the shadow buffer size calculation Chris Wilson
2019-04-18 19:40 ` [igt-dev] [PATCH i-g-t 3/5] lib/rendercopy: Add fp16 support for gen4+ Ville Syrjala
2019-04-26 19:16   ` Chris Wilson
2019-04-18 19:40 ` [igt-dev] [PATCH i-g-t 4/5] lib/rendercopy: Configure MOCS more consistently Ville Syrjala
2019-04-26 19:18   ` Chris Wilson
2019-04-26 19:27     ` Ville Syrjälä
2019-04-18 19:40 ` [igt-dev] [PATCH i-g-t 5/5] tests/kms_big_fb: Make sure huge fbs work correctly Ville Syrjala
2019-04-26 16:50   ` [igt-dev] [PATCH i-g-t v2 " Ville Syrjala
2019-04-18 20:34 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/5] lib/igt_fb: Fix the cairo shadow buffer stride Patchwork
2019-04-18 22:46 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2019-04-26 17:59 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/5] lib/igt_fb: Fix the cairo shadow buffer stride (rev2) Patchwork
2019-04-26 19:14 ` [igt-dev] [PATCH i-g-t 1/5] lib/igt_fb: Fix the cairo shadow buffer stride Chris Wilson
2019-04-26 23:41 ` [igt-dev] ✗ Fi.CI.IGT: failure for series starting with [i-g-t,1/5] lib/igt_fb: Fix the cairo shadow buffer stride (rev2) Patchwork
2019-04-29 10:24   ` Ville Syrjälä

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=20190418194043.5184-2-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.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