Skip to content

Commit d863bec

Browse files
James Patrick-Evansgregkh
authored andcommitted
media: fix airspy usb probe error path
commit aa93d1fee85c890a34f2510a310e55ee76a27848 upstream. 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> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 8727178 commit d863bec

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

drivers/media/usb/airspy/airspy.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ static int airspy_probe(struct usb_interface *intf,
10731073
if (ret) {
10741074
dev_err(s->dev, "Failed to register as video device (%d)\n",
10751075
ret);
1076-
goto err_unregister_v4l2_dev;
1076+
goto err_free_controls;
10771077
}
10781078
dev_info(s->dev, "Registered as %s\n",
10791079
video_device_node_name(&s->vdev));
@@ -1082,7 +1082,6 @@ static int airspy_probe(struct usb_interface *intf,
10821082

10831083
err_free_controls:
10841084
v4l2_ctrl_handler_free(&s->hdl);
1085-
err_unregister_v4l2_dev:
10861085
v4l2_device_unregister(&s->v4l2_dev);
10871086
err_free_mem:
10881087
kfree(s);

0 commit comments

Comments
 (0)