Re: [patch 2/2] fbcmap: integer overflow bug

From
Dan Carpenter <hidden>
Date
2010-11-15 07:21:42
Also in
kernel-janitors, lkml
Reply to
Geert Uytterhoeven, 2010-11-15
On Mon, Nov 15, 2010 at 07:56:05AM +0100, Geert Uytterhoeven wrote:
On Mon, Nov 15, 2010 at 05:48, Paul Mundt [off-list ref] wrote:
quoted
On Sat, Nov 13, 2010 at 01:07:18PM +0300, Dan Carpenter wrote:
quoted
@@ -256,8 +264,12 @@ int fb_set_user_cmap(struct fb_cmap_user *cmap, struct fb_info *info)
      int rc, size = cmap->len * sizeof(u16);
      struct fb_cmap umap;

+     if (cmap->len * 2 > INT_MAX)
Isn't that another integer overflow? I.e. should be "if (cmap->len >
INT_MAX / sizeof(u16))" instead?
Yeah it is.  :/

I'll change it to:
	if (size < 0 || size < cmap->len)
like Paul asked.

regards,
dan carpenter
Thread (10 messages) 10 messages, 5 authors, last reply 2010-11-16
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help