You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
USB: CDC ACM: Fix NULL pointer dereference
If a device specifies zero endpoints in its interface descriptor, the kernel oopses in acm_probe(). Even though that's clearly an invalid descriptor, we should test wether we have all endpoints. This is especially bad as this oops can be triggered by just plugging a USB device in. Signed-off-by: Sven Schnelle <svens@stackframe.org> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
83957df21d
commit
99f347caa4
@@ -1104,7 +1104,8 @@ skip_normal_probe:
|
||||
}
|
||||
|
||||
|
||||
if (data_interface->cur_altsetting->desc.bNumEndpoints < 2)
|
||||
if (data_interface->cur_altsetting->desc.bNumEndpoints < 2 ||
|
||||
control_interface->cur_altsetting->desc.bNumEndpoints == 0)
|
||||
return -EINVAL;
|
||||
|
||||
epctrl = &control_interface->cur_altsetting->endpoint[0].desc;
|
||||
|
||||
Reference in New Issue
Block a user