]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: fix airspy usb probe error path
authorJames Patrick-Evans <james@jmp-e.com>
Fri, 15 Jul 2016 15:40:45 +0000 (16:40 +0100)
committerSasha Levin <alexander.levin@verizon.com>
Mon, 8 Aug 2016 01:58:44 +0000 (21:58 -0400)
commitd380c88d88ed317a7493e5cba85fa0ebecf38ac9
tree93ea435d7b790e2c32e8968ea8094ab5f12aae32
parent5f51fe4b87db1002807eb448cd644afeab74339a
media: fix airspy usb probe error path

[ Upstream commit aa93d1fee85c890a34f2510a310e55ee76a27848 ]

Fix a memory leak on probe error of the airspy usb device driver.

The problem is triggered when more than 64 usb devices register with
v4l2 of type VFL_TYPE_SDR or VFL_TYPE_SUBDEV.

The memory leak is caused by the probe function of the airspy driver
mishandeling errors and not freeing the corresponding control structures
when an error occours registering the device to v4l2 core.

A badusb device can emulate 64 of these devices, and then through
continual emulated connect/disconnect of the 65th device, cause the
kernel to run out of RAM and crash the kernel, thus causing a local DOS
vulnerability.

Fixes CVE-2016-5400

Signed-off-by: James Patrick-Evans <james@jmp-e.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Cc: stable@vger.kernel.org # 3.17+
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
drivers/media/usb/airspy/airspy.c