media: saa7146: fix array overflow in vidioc_s_audio()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 17 Nov 2020 07:23:40 +0000 (08:23 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 3 Dec 2020 06:46:34 +0000 (07:46 +0100)
commit8e4d86e241cf035d6d3467cd346e7ce490681937
tree633e1a40fff713a2d11925926020b13397e6bc90
parent28c1e371c2ff445162ca6de9a81463351d9e137d
media: saa7146: fix array overflow in vidioc_s_audio()

The "a->index" value comes from the user via the ioctl.  The problem is
that the shift can wrap resulting in setting "mxb->cur_audinput" to an
invalid value, which later results in an array overflow.

Fixes: 6680427791c9 ("[media] mxb: fix audio handling")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/pci/saa7146/mxb.c