summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-04-29 01:03:59 +0300
committerSasha Levin <sasha.levin@oracle.com>2015-07-03 19:34:52 +0300
commitb5bc42d35f6d8ab18a023da8a59518b47cb13ea8 (patch)
tree620889200d90f92818c6259a47859a0e56c23054 /drivers/media
parent19e1c444111bbf4f78e9df0ad458072a86f961ad (diff)
downloadlinux-b5bc42d35f6d8ab18a023da8a59518b47cb13ea8.tar.xz
[media] cx24117: fix a buffer overflow when checking userspace params
[ Upstream commit 82e3b88b679049f043fe9b03991d6d66fc0a43c8 ] The maximum size for a DiSEqC command is 6, according to the userspace API. However, the code allows to write up much more values: drivers/media/dvb-frontends/cx24116.c:983 cx24116_send_diseqc_msg() error: buffer overflow 'd->msg' 6 <= 23 Cc: stable@vger.kernel.org Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb-frontends/cx24117.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/dvb-frontends/cx24117.c b/drivers/media/dvb-frontends/cx24117.c
index a6c3c9e2e897..d2eab0676d30 100644
--- a/drivers/media/dvb-frontends/cx24117.c
+++ b/drivers/media/dvb-frontends/cx24117.c
@@ -1043,7 +1043,7 @@ static int cx24117_send_diseqc_msg(struct dvb_frontend *fe,
dev_dbg(&state->priv->i2c->dev, ")\n");
/* Validate length */
- if (d->msg_len > 15)
+ if (d->msg_len > sizeof(d->msg))
return -EINVAL;
/* DiSEqC message */