This is an automatic generated email to let you know that the following patch were queued at the http://git.linuxtv.org/media_tree.git tree:
Subject: [media] v4l2-ctrls: fix integer overflow in v4l2_g_ext_ctrls() Author: Xi Wang <[email protected]> Date: Fri Apr 6 09:32:36 2012 -0300 A large cs->count from userspace may overflow the allocation size, leading to memory corruption. v4l2_g_ext_ctrls() can be reached from subdev_do_ioctl() or __video_do_ioctl(). Use kmalloc_array() to avoid the overflow. Signed-off-by: Xi Wang <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]> drivers/media/video/v4l2-ctrls.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) --- http://git.linuxtv.org/media_tree.git?a=commitdiff;h=5f0049bd69b96537dc7c02755c169fb4ccca3ddf diff --git a/drivers/media/video/v4l2-ctrls.c b/drivers/media/video/v4l2-ctrls.c index 3e0a72d..bf62b10 100644 --- a/drivers/media/video/v4l2-ctrls.c +++ b/drivers/media/video/v4l2-ctrls.c @@ -2036,7 +2036,8 @@ int v4l2_g_ext_ctrls(struct v4l2_ctrl_handler *hdl, struct v4l2_ext_controls *cs return class_check(hdl, cs->ctrl_class); if (cs->count > ARRAY_SIZE(helper)) { - helpers = kmalloc(sizeof(helper[0]) * cs->count, GFP_KERNEL); + helpers = kmalloc_array(cs->count, sizeof(helper[0]), + GFP_KERNEL); if (helpers == NULL) return -ENOMEM; } _______________________________________________ linuxtv-commits mailing list [email protected] http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
