Subject: CVE-2023-52754: media: imon: fix access to invalid resource for the second interface

From: Greg Kroah-Hartman <[email-masked]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

media: imon: fix access to invalid resource for the second interface

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.

The Linux kernel CVE team has assigned CVE-2023-52754 to this issue.

Affected and fixed versions
===========================

	Fixed in 5.10.202 with commit 0f5068519f89
	Fixed in 5.15.140 with commit 5e0b788fb96b
	Fixed in 6.1.64 with commit b083aaf5db2e
	Fixed in 6.5.13 with commit 10ec5a97f8f5
	Fixed in 6.6.3 with commit 2a493a34bd6e
	Fixed in 6.7 with commit a1766a4fd83b

Please see https://www.kernel.org for a full list of currently supported
kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to
older supported kernel versions.  The official CVE entry at
	https://cve.org/CVERecord/?id=CVE-2023-52754
will be updated if fixes are backported, please check that for the most
up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
	drivers/media/rc/imon.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest
stable kernel version for this, and many other bugfixes.  Individual
changes are never tested alone, but rather are part of a larger kernel
release.  Cherry-picking individual commits is not recommended or
supported by the Linux kernel community at all.  If however, updating to
the latest release is impossible, the individual changes to resolve this
issue can be found at these commits:
	https://git.kernel.org/stable/c/0f5068519f89d928d6c51100e4b274479123829f
	https://git.kernel.org/stable/c/5e0b788fb96be36d1baf1a5c88d09c7c82a0452a
	https://git.kernel.org/stable/c/b083aaf5db2eeca9e362723258e5d8698f7dd84e
	https://git.kernel.org/stable/c/10ec5a97f8f5a772a1a42b4eb27196b447cd3aa9
	https://git.kernel.org/stable/c/2a493a34bd6e496c55fabedd82b957193ace178f
	https://git.kernel.org/stable/c/a1766a4fd83befa0b34d932d532e7ebb7fab1fa7