[PATCH] OMAPFB: prevent buffer underflow in omapfb_parse_vram_param()

Subsystems: framebuffer layer, omap display subsystem and framebuffer support (dss2), the rest

STALE3183d

2 messages, 2 authors, 2017-11-17 · open the first message on its own page

[PATCH] OMAPFB: prevent buffer underflow in omapfb_parse_vram_param()

From: Dan Carpenter <hidden>
Date: 2017-11-14 06:12:48

We cap the upper bound of "fbnum" but we also need to check for
negatives or make the type unsigned.

Signed-off-by: Dan Carpenter <redacted>
diff --git a/drivers/video/fbdev/omap2/omapfb/omapfb-main.c b/drivers/video/fbdev/omap2/omapfb/omapfb-main.c
index 1d7c012f09db..e08e5664e330 100644
--- a/drivers/video/fbdev/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/fbdev/omap2/omapfb/omapfb-main.c
@@ -1477,7 +1477,7 @@ static int omapfb_alloc_fbmem_display(struct fb_info *fbi, unsigned long size,
 static int omapfb_parse_vram_param(const char *param, int max_entries,
 		unsigned long *sizes, unsigned long *paddrs)
 {
-	int fbnum;
+	unsigned int fbnum;
 	unsigned long size;
 	unsigned long paddr = 0;
 	char *p, *start;

Re: [PATCH] OMAPFB: prevent buffer underflow in omapfb_parse_vram_param()

From: Bartlomiej Zolnierkiewicz <hidden>
Date: 2017-11-17 16:21:21

On Tuesday, November 14, 2017 09:12:28 AM Dan Carpenter wrote:
We cap the upper bound of "fbnum" but we also need to check for
negatives or make the type unsigned.

Signed-off-by: Dan Carpenter <redacted>
Patch queued for 4.15, thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help