]> www.infradead.org Git - users/jedix/linux-maple.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)
committerDhaval Giani <dhaval.giani@oracle.com>
Fri, 20 Jan 2017 22:22:05 +0000 (17:22 -0500)
commit2455438009a886982b72baa0d6a6cf23bb6af359
tree227cabad9f4d73f5d1ebdd21d9484554414203a8
parent5ed9676a17c8cd937d313402221f9dcbf186b8d5
media: fix airspy usb probe error path

Orabug: 25308108

[ 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>
(cherry picked from commit ce05d315cec02835c77fa3f4b5119960e1654913)
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
drivers/media/usb/airspy/airspy.c