OpenCloudOS-Kernel/drivers/media
Takashi Iwai 2a493a34bd media: imon: fix access to invalid resource for the second interface
[ Upstream commit a1766a4fd83befa0b34d932d532e7ebb7fab1fa7 ]

imon driver probes two USB interfaces, and at the probe of the second
interface, the driver assumes blindly that the first interface got
bound with the same imon driver.  It's usually true, but it's still
possible that the first interface is bound with another driver via a
malformed descriptor.  Then it may lead to a memory corruption, as
spotted by syzkaller; imon driver accesses the data from drvdata as
struct imon_context object although it's a completely different one
that was assigned by another driver.

This patch adds a sanity check -- whether the first interface is
really bound with the imon driver or not -- for avoiding the problem
above at the probe time.

Reported-by: syzbot+59875ffef5cb9c9b29e9@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/000000000000a838aa0603cc74d6@google.com/
Tested-by: Ricardo B. Marliere <ricardo@marliere.net>
Link: https://lore.kernel.org/r/20230922005152.163640-1-ricardo@marliere.net
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-11-28 17:19:47 +00:00
..
cec media: cec: meson: always include meson sub-directory in Makefile 2023-11-20 11:59:33 +01:00
common media: vb2: frame_vector.c: replace WARN_ONCE with a comment 2023-09-14 23:31:55 +02:00
dvb-core lib/math: Move dvb_math.c into lib/math/int_log.c 2023-07-09 22:47:48 +01:00
dvb-frontends media: dvb: symbol fixup for dvb_attach() 2023-09-09 08:15:11 +01:00
firewire media: firewire: firedtv-avc.c: replace BUG with proper, error return 2023-08-10 07:58:37 +02:00
i2c media: ccs: Fix driver quirk struct documentation 2023-11-28 17:19:47 +00:00
mc media: mc: Make media_get_pad_index() use pad type flag 2023-05-25 16:21:22 +02:00
mmc
pci media: cobalt: Use FIELD_GET() to extract Link Width 2023-11-28 17:19:47 +00:00
platform media: platform: mtk-mdp3: fix uninitialized variable in mdp_path_config() 2023-11-20 11:59:33 +01:00
radio media: wl128x: Fix spelling mistake "Transfered" -> "Transferred" 2023-07-19 12:57:48 +02:00
rc media: imon: fix access to invalid resource for the second interface 2023-11-28 17:19:47 +00:00
spi
test-drivers media: vivid: avoid integer overflow 2023-11-28 17:19:46 +00:00
tuners media: dvb: symbol fixup for dvb_attach() 2023-09-09 08:15:11 +01:00
usb media: gspca: cpia1: shift-out-of-bounds in set_flicker 2023-11-28 17:19:46 +00:00
v4l2-core media: subdev: Don't report V4L2_SUBDEV_CAP_STREAMS when the streams API is disabled 2023-10-11 14:52:57 +02:00
Kconfig media: Kconfig: Make DVB_CORE=m possible when MEDIA_SUPPORT=y 2022-12-07 17:58:46 +01:00
Makefile