Skip to content

Commit a09d2d0

Browse files
V4belhdeller
authored andcommitted
video: fbdev: pxa3xx-gcu: Fix integer overflow in pxa3xx_gcu_write
In pxa3xx_gcu_write, a count parameter of type size_t is passed to words of type int. Then, copy_from_user() may cause a heap overflow because it is used as the third argument of copy_from_user(). Signed-off-by: Hyunwoo Kim <[email protected]> Signed-off-by: Helge Deller <[email protected]>
1 parent 267173c commit a09d2d0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/video/fbdev/pxa3xx-gcu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ pxa3xx_gcu_write(struct file *file, const char *buff,
381381
struct pxa3xx_gcu_batch *buffer;
382382
struct pxa3xx_gcu_priv *priv = to_pxa3xx_gcu_priv(file);
383383

384-
int words = count / 4;
384+
size_t words = count / 4;
385385

386386
/* Does not need to be atomic. There's a lock in user space,
387387
* but anyhow, this is just for statistics. */

0 commit comments

Comments
 (0)