提交 a24e6348 编写于 作者: C Colin Ian King 提交者: Mauro Carvalho Chehab

media: dvb_ca_en50221: sanity check slot number from userspace

Currently a user can pass in an unsanitized slot number which
will lead to and out of range index into ca->slot_info. Fix this
by checking that the slot number is no more than the allowed
maximum number of slots. Seems that this bug has been in the driver
forever.

Detected by CoverityScan, CID#139381 ("Untrusted pointer read")
Signed-off-by: NColin Ian King <colin.king@canonical.com>
Reviewed-by: NDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: NJasmin Jessich <jasmin@anw.at>
Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
上级 3ee6229f
......@@ -1473,6 +1473,9 @@ static ssize_t dvb_ca_en50221_io_write(struct file *file,
return -EFAULT;
buf += 2;
count -= 2;
if (slot >= ca->slot_count)
return -EINVAL;
sl = &ca->slot_info[slot];
/* check if the slot is actually running */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册