projects
/
comedi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3d13a62
)
Check integer overflow in do_insnlist_ioctl().
author
Ian Abbott
<abbotti@mev.co.uk>
Wed, 23 Nov 2011 15:16:53 +0000
(15:16 +0000)
committer
Ian Abbott
<abbotti@mev.co.uk>
Wed, 23 Nov 2011 15:16:53 +0000
(15:16 +0000)
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
comedi/comedi_fops.c
patch
|
blob
|
history
diff --git
a/comedi/comedi_fops.c
b/comedi/comedi_fops.c
index 4d3a5dd1d503213e181d20bad0b1f3fe6394886d..ed26d00113b7a79d3aed3f91f25a226d8e7691db 100644
(file)
--- a/
comedi/comedi_fops.c
+++ b/
comedi/comedi_fops.c
@@
-701,7
+701,9
@@
static int do_insnlist_ioctl(comedi_device * dev, void *arg, void *file)
goto error;
}
- insns = kmalloc(sizeof(comedi_insn) * insnlist.n_insns, GFP_KERNEL);
+ if (insnlist.n_insns <= ULONG_MAX / sizeof(comedi_insn))
+ insns = kmalloc(sizeof(comedi_insn) * insnlist.n_insns,
+ GFP_KERNEL);
if (!insns) {
DPRINTK("kmalloc failed\n");
ret = -ENOMEM;