linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] OMAPFB: prevent buffer underflow in omapfb_parse_vram_param()
@ 2017-11-14  6:12 ` Dan Carpenter
  2017-11-17 16:21   ` Bartlomiej Zolnierkiewicz
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2017-11-14  6:12 UTC (permalink / raw)
  To: Tomi Valkeinen
  Cc: linux-fbdev, linux-omap, kernel-janitors, dri-devel,
	Bartlomiej Zolnierkiewicz

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 <dan.carpenter@oracle.com>

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;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] OMAPFB: prevent buffer underflow in omapfb_parse_vram_param()
  2017-11-14  6:12 ` [PATCH] OMAPFB: prevent buffer underflow in omapfb_parse_vram_param() Dan Carpenter
@ 2017-11-17 16:21   ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 2+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2017-11-17 16:21 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: linux-omap, Tomi Valkeinen, kernel-janitors, linux-fbdev,
	dri-devel

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 <dan.carpenter@oracle.com>

Patch queued for 4.15, thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-17 16:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20171114061251epcas2p3eea18fd03e87cefd3d7b30750a0f1833@epcas2p3.samsung.com>
2017-11-14  6:12 ` [PATCH] OMAPFB: prevent buffer underflow in omapfb_parse_vram_param() Dan Carpenter
2017-11-17 16:21   ` Bartlomiej Zolnierkiewicz

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).